move into sonardesk
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Sites\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
final class SiteContent extends Model
|
||||
{
|
||||
protected $table = 'site_content';
|
||||
|
||||
protected $fillable = ['site_id', 'content_type', 'content_id', 'is_primary'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['is_primary' => 'boolean'];
|
||||
}
|
||||
|
||||
public function site(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Site::class);
|
||||
}
|
||||
|
||||
public function content(): MorphTo
|
||||
{
|
||||
return $this->morphTo(__FUNCTION__, 'content_type', 'content_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user