You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
459 B
PHP
28 lines
459 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
|
|
|
class Banner extends Model
|
|
{
|
|
protected $fillable = [
|
|
'image',
|
|
'title',
|
|
'description',
|
|
'destination',
|
|
'type',
|
|
];
|
|
|
|
protected $appends = [
|
|
'image_url',
|
|
];
|
|
|
|
protected function imageUrl(): Attribute
|
|
{
|
|
return Attribute::make(get: function () {
|
|
return asset($this->image);
|
|
});
|
|
}
|
|
}
|