54 lines
1.1 KiB
PHP
54 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\DansLesPresType;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Kwaadpepper\Enum\Traits\CastsEnums;
|
|
|
|
class DansLesPresContent extends Model
|
|
{
|
|
use HasFactory;
|
|
use CastsEnums;
|
|
|
|
/**
|
|
* The attributes that should be cast to Enums.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $enumCasts = [
|
|
'type' => DansLesPresType::class
|
|
];
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'picture',
|
|
// * Only youtube for now ( vu avec sylvain )
|
|
'video_link',
|
|
'content',
|
|
'type',
|
|
'order',
|
|
'isVideo',
|
|
'status'
|
|
];
|
|
|
|
/**
|
|
* Perform any actions required after the model boots.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected static function booted()
|
|
{
|
|
static::creating(function ($ocbContent) {
|
|
$ocbContent->content = clean($ocbContent->content);
|
|
});
|
|
static::updating(function ($ocbContent) {
|
|
$ocbContent->content = clean($ocbContent->content);
|
|
});
|
|
}
|
|
}
|