43 lines
818 B
PHP
43 lines
818 B
PHP
|
|
<?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');
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|