40 lines
1,008 B
PHP
40 lines
1,008 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\Page;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Traits\EnumeratesValues;
|
|
use Kwaadpepper\Enum\Traits\CastsEnums;
|
|
|
|
class Picto extends Model
|
|
{
|
|
use HasFactory;
|
|
use CastsEnums;
|
|
|
|
public $enumCasts = [
|
|
'page' => Page::class
|
|
];
|
|
|
|
protected $fillable = [
|
|
'picture',
|
|
'text',
|
|
];
|
|
|
|
// protected static function boot()
|
|
// {
|
|
// static::creating(function (EncartArg $encartArg) {
|
|
// if ($encartArg->picture) {
|
|
// $encartArg->picture = Utils::storeImage($encartArg->picture, $encartArg->getTable());
|
|
// }
|
|
// });
|
|
|
|
// static::updating(function (EncartArg $encartArg) {
|
|
// if ($encartArg->picture) {
|
|
// $encartArg->picture = Utils::storeImage($encartArg->picture, $encartArg->getTable());
|
|
// }
|
|
// });
|
|
// parent::boot();
|
|
// }
|
|
}
|