- Fix EventType deletion error handling (constraint violations) - Fix Event update error (package_id column missing) - Fix Event Type dropdown options (JSON display issue) - Fix EventPackagesRelationManager query error - Add missing translations for deletion errors - Apply Pint formatting
54 lines
1.1 KiB
PHP
54 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class EventMediaAsset extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'event_id',
|
|
'media_storage_target_id',
|
|
'photo_id',
|
|
'variant',
|
|
'disk',
|
|
'path',
|
|
'size_bytes',
|
|
'checksum',
|
|
'mime_type',
|
|
'status',
|
|
'processed_at',
|
|
'archived_at',
|
|
'restored_at',
|
|
'error_message',
|
|
'meta',
|
|
];
|
|
|
|
protected $casts = [
|
|
'size_bytes' => 'integer',
|
|
'processed_at' => 'datetime',
|
|
'archived_at' => 'datetime',
|
|
'restored_at' => 'datetime',
|
|
'meta' => 'array',
|
|
];
|
|
|
|
public function event(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Event::class);
|
|
}
|
|
|
|
public function storageTarget(): BelongsTo
|
|
{
|
|
return $this->belongsTo(MediaStorageTarget::class, 'media_storage_target_id');
|
|
}
|
|
|
|
public function photo(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Photo::class);
|
|
}
|
|
}
|