Skip to content

Commit 9293002

Browse files
committed
Merge branch 'patch-add-attributes-to-filters' of https://github.com/DeltaSystems/laravel-livewire-tables into DeltaSystems-patch-add-attributes-to-filters
2 parents 9d6bb5e + 64722e9 commit 9293002

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "rappasoft/laravel-livewire-tables",
2+
"name": "deltasystems/laravel-livewire-tables",
33
"description": "A dynamic table component for Laravel Livewire",
44
"keywords": [
55
"rappasoft",

resources/views/tailwind/includes/table.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class="rounded border-gray-300 text-indigo-600 shadow-sm transition duration-150
9696
@forelse ($rows as $index => $row)
9797
<x-livewire-tables::table.row
9898
wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60"
99-
wire:key="table-row-{{ $row->{$primaryKey} }}"
99+
wire:key="table-row-{{ md5(rand()) }}-{{ $row->{\Rappasoft\LaravelLivewireTables\Utilities\ColumnUtilities::parseField($primaryKey)} }}"
100100
wire:sortable.item="{{ $row->{$primaryKey} }}"
101101
:reordering="$reordering"
102102
:url="method_exists($this, 'getTableRowUrl') ? $this->getTableRowUrl($row) : ''"

src/Views/Filter.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,30 @@ class Filter
2828
*/
2929
public array $options = [];
3030

31+
/**
32+
* @var array
33+
*/
34+
public array $attributes = [];
35+
3136
/**
3237
* Filter constructor.
3338
*
3439
* @param string $name
3540
*/
36-
public function __construct(string $name)
41+
public function __construct(string $name, ?array $attributes = [])
3742
{
3843
$this->name = $name;
44+
$this->attributes = $attributes;
3945
}
4046

4147
/**
4248
* @param string $name
4349
*
4450
* @return Filter
4551
*/
46-
public static function make(string $name): Filter
52+
public static function make(string $name, ?array $attributes = []): Filter
4753
{
48-
return new static($name);
54+
return new static($name, $attributes);
4955
}
5056

5157
/**

0 commit comments

Comments
 (0)