- create enums for channel - create model and migration - create many to many relation to theme - feat resource
29 lines
574 B
PHP
29 lines
574 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\IsActive;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Theme extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'is_active' => IsActive::class,
|
|
'sort_order' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function mediaMonitorings(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(MediaMonitoring::class);
|
|
}
|
|
}
|