retrofairie/resources/views/categories/index.blade.php
2025-02-23 12:01:22 -08:00

53 lines
1.4 KiB
PHP

<x-layout title="Categories">
<x-window>
<div class="sunken-panel">
<table class="interactive">
<thead>
<tr>
<th>Category</th>
<th>Actions</th>
</tr>
</thead>
<tbody
x-data="{ hovered: null }"
x-on:mouseleave="hovered = null"
>
@foreach ($categories as $category)
<tr
id="{{ $category->id }}"
x-on:mouseenter="hovered = $event.target.id"
x-bind:class="{ 'highlighted': hovered === $el.id }"
>
<td>{{ $category->name }}</td>
<td>
<a href="{{ route('categories.show', $category->id) }}">
View
</a>
@auth
<a
href="{{ route('categories.edit', $category->id) }}"
class="ml-1"
>
Edit
</a>
<a
href="{{ route('categories.destroy', $category->id) }}"
class="ml-1"
>
Delete
</a>
@endauth
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@auth
<a href="{{ route('categories.create') }}" class="button">New</a>
@endauth
</x-window>
</x-layout>