resources/views/admin/admin/index.blade.php: use datatable component.
This commit is contained in:
parent
73e49332cd
commit
b2e7bae463
1 changed files with 16 additions and 17 deletions
|
|
@ -1,21 +1,20 @@
|
|||
<x-layout name="admin">
|
||||
|
||||
<table class="table-fixed w-full">
|
||||
|
||||
<tr class="text-left border-b-2">
|
||||
<th class="border px-6 py-3">Username</th>
|
||||
<th class="border px-6 py-3">Created</th>
|
||||
<th class="border px-6 py-3">Updated</th>
|
||||
</tr>
|
||||
|
||||
@foreach($items as $item)
|
||||
<tr class="bg-gray-100">
|
||||
<td class="border px-4 py-2">{{ $item->username }}</td>
|
||||
<td class="border px-4 py-2">{{ $item->created_at }}</td>
|
||||
<td class="border px-4 py-2">{{ $item->updated_at }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</table>
|
||||
@livewire('datatable', [
|
||||
'model' => \App\Models\Admin::class,
|
||||
'default_sort' => 'id',
|
||||
'columns' => [
|
||||
'id' => '#',
|
||||
'username' => 'Username',
|
||||
'created_at' => 'Created',
|
||||
'updated_at' => 'Updated',
|
||||
],
|
||||
'sort_columns' => [
|
||||
'id' => 'id',
|
||||
'username' => 'username',
|
||||
'created_at' => 'created_at',
|
||||
'updated_at' => 'updated_at'
|
||||
]
|
||||
])
|
||||
|
||||
</x-layout>
|
||||
|
|
|
|||
Reference in a new issue