<?php

namespace App\Models;

use App\Models\Concerns\BelongsToCompany;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class CompanyModule extends Model
{
    use BelongsToCompany;

    protected $fillable = ['company_id', 'module_id', 'is_enabled', 'notes'];

    protected function casts(): array
    {
        return ['is_enabled' => 'boolean'];
    }

    public function module(): BelongsTo
    {
        return $this->belongsTo(Module::class);
    }
}
