commit13
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?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.'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user