Optimierung 5.3 (Teil 2): Category::localizedName()
Name aus der locale-gefiltert geladenen Uebersetzung mit #id-Fallback als Model-Methode. Ersetzt die identische Inline-Logik an 4 Stellen (Footer-Codes und Kategorien jeweils create/edit). Test: CategoryLocalizedNameTest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
69395efa53
commit
40679119c3
6 changed files with 32 additions and 4 deletions
|
|
@ -99,7 +99,7 @@ new #[Layout('components.layouts.app'), Title('Footer-Code bearbeiten')] class e
|
|||
->get()
|
||||
->map(fn (Category $cat) => [
|
||||
'id' => $cat->id,
|
||||
'name' => $cat->translations->first()?->name ?? '#'.$cat->id,
|
||||
'name' => $cat->localizedName(),
|
||||
'portal' => $cat->portal->value,
|
||||
]),
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue