<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Package extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'months',
        'price',
        'payable_charge',
        'description',
        'is_active',
    ];

    protected $casts = [
        'months' => 'integer',
        'price' => 'decimal:2',
        'payable_charge' => 'decimal:2',
        'is_active' => 'boolean',
    ];

    public function subscriptions()
    {
        return $this->hasMany(Subscription::class);
    }
}
