Implement creator studio and upload updates
This commit is contained in:
@@ -379,6 +379,18 @@ class Artwork extends Model
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::saving(function (Artwork $artwork): void {
|
||||
if ($artwork->published_at === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$publishedAt = $artwork->published_at->copy();
|
||||
|
||||
if ($artwork->created_at === null || ! $artwork->created_at->equalTo($publishedAt)) {
|
||||
$artwork->created_at = $publishedAt;
|
||||
}
|
||||
});
|
||||
|
||||
static::deleting(function (Artwork $artwork): void {
|
||||
if (! method_exists($artwork, 'isForceDeleting') || ! $artwork->isForceDeleting()) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user