Save workspace changes
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\ArtworkVersion
|
||||
*
|
||||
* Represents a single immutable snapshot of an artwork file.
|
||||
* Only one version per artwork is marked is_current = true at a time.
|
||||
*/
|
||||
class ArtworkVersion extends Model
|
||||
{
|
||||
protected $table = 'artwork_versions';
|
||||
|
||||
protected $fillable = [
|
||||
'artwork_id',
|
||||
'version_number',
|
||||
'file_path',
|
||||
'file_hash',
|
||||
'width',
|
||||
'height',
|
||||
'file_size',
|
||||
'change_note',
|
||||
'is_current',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_current' => 'boolean',
|
||||
'version_number' => 'integer',
|
||||
'width' => 'integer',
|
||||
'height' => 'integer',
|
||||
'file_size' => 'integer',
|
||||
];
|
||||
|
||||
public function artwork(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Artwork::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user