categories.show

This commit is contained in:
punkfairie 2025-02-21 11:48:18 -08:00
parent e5837c0537
commit f63f5bab04
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
3 changed files with 12 additions and 2 deletions

View file

@ -40,7 +40,7 @@ public function show(Category $category)
{ {
$this->authorize('view', $category); $this->authorize('view', $category);
return $category; return View::make('categories.show', ['category' => $category]);
} }
public function update(CategoryRequest $request, Category $category) public function update(CategoryRequest $request, Category $category)

View file

@ -17,7 +17,9 @@
x-bind:class="{ 'highlighted': hovered === $el.id }" x-bind:class="{ 'highlighted': hovered === $el.id }"
> >
<td>{{ $category->name }}</td> <td>{{ $category->name }}</td>
<td></td> <td>
<a href="{{ route('categories.show', $category->id) }}">View</a>
</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>

View file

@ -0,0 +1,8 @@
<x-app-layout>
<x-slot:title>
Category: {{ $category->name }}
</x-slot>
<h2>{{ $category->name }}</h2>
<a href="{{ route('categories.index') }}">All</a>
</x-app-layout>