<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Academy extends Model
{
    protected $fillable = [
        'name',
        'is_sub_academy',
        'academy_id'
    ];

    public function child() {
        return $this->hasMany(Academy::class, 'academy_id');
    }

    public function parent() {
        return $this->belongsTo(Academy::class, 'academy_id');
    }

    protected $casts = [
        'is_sub_academy' => 'boolean',
    ];
}
