Rewrite RecipeHistory without InteractsWithTable to fix 404
Deploy / deploy (push) Successful in 17s
Deploy / deploy (push) Successful in 17s
The Filament table boot lifecycle (bootedInteractsWithTable) fires before mount(), causing issues with typed $record properties on custom resource pages. Replaced with a plain Page + Blade view rendering recipes directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
dd710cb1c0
commit
6f78b22285
2 files changed
+57
-37
No files matched your search
+40
-1
@@ -1,3 +1,42 @@
|
||||
<x-filament-panels::page>
|
||||
{{ $this->table }}
|
||||
<div class="fi-ta rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10">
|
||||
<table class="w-full table-auto divide-y divide-gray-200 dark:divide-white/5 text-sm">
|
||||
<thead>
|
||||
<tr class="bg-gray-50 dark:bg-white/5">
|
||||
<th class="px-4 py-3 text-left font-medium text-gray-600 dark:text-gray-400">Version</th>
|
||||
<th class="px-4 py-3 text-left font-medium text-gray-600 dark:text-gray-400">Zutaten</th>
|
||||
<th class="px-4 py-3 text-left font-medium text-gray-600 dark:text-gray-400">Erstellt am</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100 dark:divide-white/5">
|
||||
@forelse ($this->getRecipes() as $recipe)
|
||||
<tr class="hover:bg-gray-50 dark:hover:bg-white/5">
|
||||
<td class="px-4 py-3">
|
||||
@if ($recipe->id === $this->currentRecipeId)
|
||||
<span class="inline-flex items-center rounded-full bg-green-100 px-2 py-0.5 text-xs font-semibold text-green-700 dark:bg-green-500/20 dark:text-green-400">
|
||||
v{{ $recipe->version }}
|
||||
</span>
|
||||
@else
|
||||
<span class="inline-flex items-center rounded-full bg-gray-100 px-2 py-0.5 text-xs font-semibold text-gray-600 dark:bg-white/10 dark:text-gray-400">
|
||||
v{{ $recipe->version }}
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-gray-700 dark:text-gray-300">
|
||||
{{ $recipe->spices->map(fn ($s) => $s->name . ' ' . $s->pivot->amount_in_percent . '%')->implode(' · ') ?: '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-gray-500 dark:text-gray-400">
|
||||
{{ $recipe->created_at->format('d.m.Y H:i') }}
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="3" class="px-4 py-8 text-center text-gray-400">
|
||||
Keine Rezeptversionen vorhanden.
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</x-filament-panels::page>
|
||||
Reference in new issue
Block a user