feat: add slider image
This commit is contained in:
@@ -3,12 +3,18 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Slider extends Model
|
||||
{
|
||||
protected $fillable = ['title', 'description', 'url','action'];
|
||||
protected $fillable = ['title', 'description', 'url', 'action', 'image_id'];
|
||||
|
||||
protected $casts = [
|
||||
'action' => 'array', // auto convert JSON to array
|
||||
];
|
||||
|
||||
public function image(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Image::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user