<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class SlideshowBanner extends Model
{
    use HasFactory;

    protected $fillable = [
        'banner_image',
        'banner_title',
        'banner_description',
        'banner_link',
        'order',
        'status',
    ];
    protected static function boot()
    {
        parent::boot();

        static::saved(function () {
            \Illuminate\Support\Facades\Cache::forget('home_hero_slides');
        });

        static::deleted(function () {
            \Illuminate\Support\Facades\Cache::forget('home_hero_slides');
        });
    }
}
