<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class HomeAcademySection extends Model
{
    protected $table = 'home_academy_sections';
    protected $guarded = ['id'];

    public function boxes()
    {
        return $this->hasMany('App\Models\HomeAcademySectionBox', 'home_academy_section_id', 'id')->orderBy('order', 'asc');
    }

    public static function getActive()
    {
        return self::where('status', true)->with('boxes')->first();
    }
}









