<?php

namespace App;

use App\Scopes\AcademicSchoolScope;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class SmLeaveType extends Model
{
    use HasFactory;

    protected $casts = [
        'id' => 'integer'
    ];

    protected static function boot(){
        parent::boot();
        static::addGlobalScope(new AcademicSchoolScope);
    }
    public function leaveDefines()
    {
        return $this->hasMany(SmLeaveDefine::class, 'type_id');
    }
}
