This commit is contained in:
2024-06-21 19:27:40 +02:00
parent 813874a847
commit 071eb18792
32 changed files with 285 additions and 1654 deletions

View File

@@ -49,6 +49,12 @@ class Image extends Model implements HasThumbnail
$this->save();
}
public function makeCover() : void {
Image::where('isCover', 1)->where('album_id', $this->album_id)->update(['isCover' => 0]);
$this->isCover = true;
$this->save();
}
public function getLightboxAttribute() : array {
return [
'location' => route('image.lightbox', $this) . '?cacheBuster3000=' . $this->updated_at->timestamp,