Files
ai-web/app/Models/HomeModuleItem.php

43 lines
818 B
PHP
Raw Permalink Normal View History

2026-02-12 15:37:49 +08:00
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class HomeModuleItem extends Model
{
use HasFactory;
protected $fillable = [
'home_module_id',
'item_key',
'title',
'subtitle',
'image_path',
'link_type',
'link_target',
'sort_order',
'enabled',
'extra',
];
protected function casts(): array
{
return [
'enabled' => 'boolean',
'sort_order' => 'integer',
'extra' => 'array',
];
}
public function module(): BelongsTo
{
return $this->belongsTo(HomeModule::class, 'home_module_id');
}
}