Feature: Reviews restructuring and Creating Collection Indexer and Services
This commit is contained in:
+14
-3
@@ -199,9 +199,20 @@ registered.
|
||||
### Seeding
|
||||
|
||||
A starter set of common e-shop labels (`nav.*`, `cart.*`, `product.*`, `auth.*`, `search.*`,
|
||||
English + Greek) is seeded by `Modules\Core\Command\InstallLunarCommand` (overrides Lunar's own
|
||||
`lunar:install`), guarded by `LanguageLine::where('group', 'storefront')->exists()` — same
|
||||
idempotent pattern as the rest of that command, safe to run unattended on every boot.
|
||||
`review.*`, `shop.*`, `pagination.*`, English + Greek) lives in
|
||||
`Modules\Core\Localization\Services\StorefrontLabels::all()` — kept as its own class, separate
|
||||
from the seeding logic, so the label list can be scanned/diffed without wading through the
|
||||
seeding mechanics.
|
||||
|
||||
`Modules\Core\Command\InstallLunarCommand` (overrides Lunar's own `lunar:install`) seeds them via
|
||||
a **per-key upsert**, not an all-or-nothing "only seed if the group is empty" guard: a key already
|
||||
present in the database — including one an admin has since edited via the Filament **Language
|
||||
Lines** resource — is left untouched; only keys missing entirely are created. This is what makes
|
||||
it safe to add new keys to `StorefrontLabels::all()` later and re-run `lunar:install` on an
|
||||
already-installed store, without either silently skipping the new keys (the old guard's behavior)
|
||||
or reverting an admin's edits back to the hardcoded default (what a naive `updateOrCreate` would
|
||||
do). New writes go through `TranslationService::create()`, so the usual cache-invalidation and
|
||||
activity-log events fire for them too.
|
||||
|
||||
### Admin UI
|
||||
|
||||
|
||||
Reference in New Issue
Block a user