<?php

namespace App\Models;

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

class HomepageLayout extends Model
{
    use HasFactory;

    protected $fillable = ['layout'];

    // Varsayılan olarak layout verisi boş bir dizi olarak dönsün
    public function getLayoutAttribute($value)
    {
        return $value ? json_decode($value, true) : [];
    }
}