<?php
namespace App\Models;

use App\Models\Concerns\HasPublicId;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;

final class Department extends Model
{
    use HasPublicId;


protected $fillable = ['public_id','company_id','branch_id','code','name','is_active'];
protected function casts(): array { return ['is_active'=>'boolean']; }
public function company(): BelongsTo { return $this->belongsTo(Company::class); }
public function branch(): BelongsTo { return $this->belongsTo(Branch::class); }
}
