| Current Path : /var/www/html/dynaweb-cms-v1/app/Models/Backend/ |
| Current File : /var/www/html/dynaweb-cms-v1/app/Models/Backend/FrontendPageComponent.php |
<?php
namespace App\Models\Backend;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
#[Table('frontend_page_components')]
#[Fillable([
'page_fk', 'component_fk', 'sort', 'params',
])]
class FrontendPageComponent extends Model
{
use HasFactory;
protected function casts(): array
{
return [
'sort' => 'integer',
'params' => 'array',
];
}
public function page()
{
return $this->belongsTo(FrontendPage::class, 'page_fk');
}
public function component()
{
return $this->belongsTo(FrontendComponent::class, 'component_fk');
}
}