27 lines
547 B
PHP
27 lines
547 B
PHP
<?php
|
|
|
|
namespace Modules\Media\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Support\Str;
|
|
|
|
final class Media extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'media';
|
|
|
|
protected $guarded = [];
|
|
|
|
protected static function booted(): void
|
|
{
|
|
self::creating(fn (self $m) => $m->uuid ??= (string) Str::uuid());
|
|
}
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['metadata' => 'array', 'size' => 'integer', 'sort_order' => 'integer'];
|
|
}
|
|
}
|