Files
2026-11-02 08:08:05 +02:00

35 lines
853 B
PHP

<?php
namespace App\Models;
use App\Models\Concerns\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
/**
* @property array<string,mixed> $data
* @property array<string,mixed> $snapshot
* @property int $version
* @property string $record_key
* @property \Illuminate\Support\Carbon $created_at
*/
class SupplyRecord extends Model
{
use BelongsToTenant;
public $timestamps = false;
protected $guarded = ['id'];
/** @return array<string,string> */
protected function casts(): array
{
return ['data' => 'array', 'snapshot' => 'array', 'created_at' => 'datetime'];
}
protected static function booted(): void
{
static::updating(fn () => throw new \LogicException('Criar uma nova versão.'));
static::deleting(fn () => throw new \LogicException('Preservar histórico.'));
}
}