feat: add slider image

This commit is contained in:
2026-06-22 16:56:00 +03:30
parent 7c1da7d5d7
commit 1a0645daef
4 changed files with 53 additions and 7 deletions
+7 -1
View File
@@ -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);
}
}