From 6257c83ccbc4eadde9bb28609dfaef823e0f1cf3 Mon Sep 17 00:00:00 2001 From: Julian Prieber Date: Wed, 3 Jan 2024 18:42:50 +0100 Subject: [PATCH] Added multi select --- app/Http/Livewire/UserTable.php | 4 ++ .../table-components/select.blade.php | 7 ++ resources/views/panel/users.blade.php | 72 ++++++++++++++++++- 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 resources/views/components/table-components/select.blade.php diff --git a/app/Http/Livewire/UserTable.php b/app/Http/Livewire/UserTable.php index b7d9f93..bd5b998 100644 --- a/app/Http/Livewire/UserTable.php +++ b/app/Http/Livewire/UserTable.php @@ -23,6 +23,10 @@ class UserTable extends DataTableComponent public function columns(): array { return [ + Column::make("", "id") + ->format(function ($value, $row, Column $column) { + return view('components.table-components.select', ['user' => $row]); + }), Column::make(__('messages.ID'), "id") ->sortable() ->searchable(), diff --git a/resources/views/components/table-components/select.blade.php b/resources/views/components/table-components/select.blade.php new file mode 100644 index 0000000..d969230 --- /dev/null +++ b/resources/views/components/table-components/select.blade.php @@ -0,0 +1,7 @@ +@if($user->id == 1) + +@else +
+ +
+@endif \ No newline at end of file diff --git a/resources/views/panel/users.blade.php b/resources/views/panel/users.blade.php index 863250f..d338f10 100755 --- a/resources/views/panel/users.blade.php +++ b/resources/views/panel/users.blade.php @@ -22,10 +22,22 @@

{{__('messages.Manage Users')}}

+
+
{{__('messages.Select Action')}}:
+ +
+ + {{__('messages.Add new user')}} - + +