<?php

namespace App\Models\Central;

use Illuminate\Database\Eloquent\Model;

class Plan extends Model
{
    protected $fillable = [
        'slug', 'name', 'price_monthly', 'price_yearly', 'currency',
        'features', 'limits', 'is_active', 'is_public', 'is_demo', 'trial_days',
    ];

    protected $casts = [
        'features' => 'array',
        'limits' => 'array',
        'is_active' => 'boolean',
        'is_public' => 'boolean',
        'is_demo' => 'boolean',
        'trial_days' => 'integer',
        'price_monthly' => 'decimal:2',
        'price_yearly' => 'decimal:2',
    ];

    public function companies()
    {
        return $this->hasMany(Company::class);
    }
}
