You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

47 lines
1.5 KiB

<div class="p-4">
<div class="flex justify-between mb-4">
<input
type="text"
wire:model.debounce.300ms="search"
placeholder="Search permissions..."
class="border p-2"
>
<a href="{{ route('permissions.create') }}" class="btn btn-primary">
New Permission
</a>
</div>
@if (session()->has('message'))
<div class="alert alert-success mb-2">{{ session('message') }}</div>
@endif
<table class="w-full table-auto border-collapse border">
<thead>
<tr>
<th class="border px-2 py-1">ID</th>
<th class="border px-2 py-1">Name</th>
<th class="border px-2 py-1">Actions</th>
</tr>
</thead>
<tbody>
@foreach($permissions as $p)
<tr>
<td class="border px-2 py-1">{{ $p->id }}</td>
<td class="border px-2 py-1">{{ $p->name }}</td>
<td class="border px-2 py-1">
<a
href="{{ route('permissions.edit', $p) }}"
class="text-blue-600"
>Edit</a>
<button
wire:click="delete({{ $p->id }})"
class="text-red-600 ml-2"
>Delete</button>
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-4">{{ $permissions->links() }}</div>
</div>