<?php

namespace App\Models;

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

class Banner extends Model
{
    use HasFactory;
    protected $fillable = ['thumb_image', 'status'];
    protected $appends = ['thumb_image_public_url'];

    public function getThumbImagePublicUrlAttribute()
    {
        return $this->attributes['thumb_image'] ? env('APP_URL') . '/' . $this->attributes['thumb_image'] : 'public/images/banner-placeholder.jpg';
    }
}
