ldc-legaulois/app/Models/OCBContent.php
Jérémy Munsch 34da0f98a1 tons of fix
2021-05-05 15:13:33 +02:00

36 lines
726 B
PHP

<?php
namespace App\Models;
use App\Enums\OCBType;
use Illuminate\Database\Eloquent\Model;
use Kwaadpepper\Enum\Traits\CastsEnums;
class OCBContent extends Model
{
use CastsEnums;
protected $enumCasts = [
'type' => OCBType::class
];
protected $table = 'ocb_content';
protected $fillable = [
'picture',
'content',
'type',
'order',
'status'
];
protected static function booted()
{
static::creating(function ($ocbContent) {
$ocbContent->content = clean($ocbContent->content);
});
static::updating(function ($ocbContent) {
$ocbContent->content = clean($ocbContent->content);
});
}
}