feat: increase gallery grid from 4 to 5 columns per row on desktopfeat: increase gallery grid from 4 to 5 columns per row on desktop

This commit is contained in:
2026-02-25 19:11:23 +01:00
parent 5c97488e80
commit 0032aec02f
131 changed files with 15674 additions and 597 deletions

View File

@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace App\Observers;
use App\Models\Artwork;
use App\Services\ArtworkSearchIndexer;
/**
* Syncs artwork documents to Meilisearch on every relevant model event.
*
* All operations are dispatched to the queue no blocking calls.
*/
class ArtworkObserver
{
public function __construct(
private readonly ArtworkSearchIndexer $indexer
) {}
/** New artwork created — index once published and approved. */
public function created(Artwork $artwork): void
{
$this->indexer->index($artwork);
}
/** Artwork updated — covers publish, approval, metadata changes. */
public function updated(Artwork $artwork): void
{
// When soft-deleted, remove from index immediately.
if ($artwork->isDirty('deleted_at') && $artwork->deleted_at !== null) {
$this->indexer->delete($artwork->id);
return;
}
$this->indexer->update($artwork);
}
/** Soft delete — remove from search. */
public function deleted(Artwork $artwork): void
{
$this->indexer->delete($artwork->id);
}
/** Force delete — ensure removal from index. */
public function forceDeleted(Artwork $artwork): void
{
$this->indexer->delete($artwork->id);
}
/** Restored from soft-delete — re-index. */
public function restored(Artwork $artwork): void
{
$this->indexer->index($artwork);
}
}