app/Http/Controllers/Admin/*Controller.php: refactoring so that all controllers share similar code by inheriting from BaseController and set $_datatable property.
This commit is contained in:
parent
6482020dfd
commit
0c493c2978
8 changed files with 76 additions and 116 deletions
|
|
@ -1,20 +0,0 @@
|
|||
<x-layout name="admin">
|
||||
|
||||
@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>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
<x-layout name="admin">
|
||||
|
||||
@livewire('datatable', [
|
||||
'model' => \App\Models\Card::class,
|
||||
'default_sort' => 'id',
|
||||
'route_create' => 'admin.card.create',
|
||||
'route_edit' => 'admin.card.edit',
|
||||
'delete_enabled' => true,
|
||||
'restore_enabled' => true,
|
||||
'columns' => [
|
||||
'id' => '#',
|
||||
'body' => 'Body',
|
||||
'subject' => 'Subject',
|
||||
'subject_type' => 'Subject Type',
|
||||
'raid.name' => 'Raid',
|
||||
],
|
||||
'sort_columns' => [
|
||||
'id' => 'id',
|
||||
'body' => 'body',
|
||||
'subject' => ['character.name', 'class', 'role'],
|
||||
'raid.name' => 'raid.name',
|
||||
]
|
||||
])
|
||||
|
||||
</x-layout>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<x-layout name="admin">
|
||||
|
||||
@livewire('datatable', [
|
||||
'model' => \App\Models\Character::class,
|
||||
'default_sort' => 'id',
|
||||
'route_create' => 'admin.character.create',
|
||||
'route_edit' => 'admin.character.edit',
|
||||
'delete_enabled' => true,
|
||||
'restore_enabled' => true,
|
||||
'columns' => [
|
||||
'id' => '#',
|
||||
'name' => 'Name',
|
||||
],
|
||||
'sort_columns' => [
|
||||
'id' => 'id',
|
||||
'name' => 'name',
|
||||
]
|
||||
])
|
||||
|
||||
</x-layout>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<x-layout name="admin">
|
||||
|
||||
@livewire('datatable', [
|
||||
'model' => \App\Models\Raid::class,
|
||||
'default_sort' => 'id',
|
||||
'route_create' => 'admin.raid.create',
|
||||
'route_edit' => 'admin.raid.edit',
|
||||
'delete_enabled' => true,
|
||||
'restore_enabled' => true,
|
||||
'columns' => [
|
||||
'id' => '#',
|
||||
'name' => 'Name',
|
||||
],
|
||||
'sort_columns' => [
|
||||
'id' => 'id',
|
||||
'name' => 'name',
|
||||
]
|
||||
])
|
||||
|
||||
</x-layout>
|
||||
Reference in a new issue