<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class DevicePreset extends Model
{
    /**
     * Defense-in-depth — `device_presets` is seeded via migrations + read by
     * the editor / picker; no controller path mass-assigns to it. Empty
     * fillable means a future endpoint that accidentally does
     * `DevicePreset::create($request->all())` writes nothing instead of
     * letting a request body shape `is_active=false` / `has_real_frame=true`
     * through. Migrations + tinker assignments use direct property sets,
     * not `create()` / `fill()`, so this is invisible to the seed path.
     */
    protected $fillable = [];

    protected function casts(): array
    {
        return [
            'export_w' => 'integer',
            'export_h' => 'integer',
            'safe_area' => 'array',
            'is_active' => 'boolean',
            'has_real_frame' => 'boolean',
            'real_frame_color_options' => 'array',
            'real_frame_screen_rect' => 'array',
        ];
    }
}
