diff options
Diffstat (limited to 'resources/views')
-rw-r--r-- | resources/views/table.blade.php | 10 | ||||
-rw-r--r-- | resources/views/toolbar/select-filter.blade.php | 23 |
2 files changed, 32 insertions, 1 deletions
diff --git a/resources/views/table.blade.php b/resources/views/table.blade.php index bcefe57..448a290 100644 --- a/resources/views/table.blade.php +++ b/resources/views/table.blade.php @@ -9,7 +9,15 @@ <thead> <tr> @foreach($columns as $column) - <th scope="col">{{ $column->getTitle() }}</th> + <th + scope="col" + @class(['sortable' => $column->isSortable()]) + @if($column->isSortable()) + wire:click="orderBy('{{ $column->name }}')" + @endif + > + {{ $column->getTitle() }} + </th> @endforeach </tr> </thead> diff --git a/resources/views/toolbar/select-filter.blade.php b/resources/views/toolbar/select-filter.blade.php new file mode 100644 index 0000000..13cdbc1 --- /dev/null +++ b/resources/views/toolbar/select-filter.blade.php @@ -0,0 +1,23 @@ +<div class="filter d-flex align-items-center"> + @if ($label) + <label for="{{ $id }}" class="mx-3"> + {{ $label }} + </label> + @endif + <select + id="{{ $id }}" + class="form-control" + wire:model.live="filters.{{ $key }}" + > + @if (!empty($placeholder)) + <option value=""> + {{ $placeholder }} + </option> + @endif + @foreach ($options as $value => $option) + <option value="{{ $value }}"> + {{ $option }} + </option> + @endforeach + </select> +</div> |