*/ protected $fillable = [ 'title', 'message', 'type' ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'type' => InfoColorsEnum::class, ]; // * EVENTS /** * Perform any actions required after the model boots. * * @return void */ protected static function booted(): void { static::created(function () { cache()->put('infos', Information::all(), 3600); }); static::updated(function () { cache()->put('infos', Information::all(), 3600); }); static::deleted(function () { cache()->put('infos', Information::all(), 3600); }); } }