Replies: 12 comments
-
Did you mean splade data table filter ? php artisan make:table Users will look like this $table
// ...other column's
->selectFilter(
key: 'id',
label: 'Country',
options: \App\Models\Country::all(['id', 'name'])->toArray()
)
// ...other column's @luisvbz CMIIW |
Beta Was this translation helpful? Give feedback.
-
Yes, I know it has those filters. Actually, I use them quite often. @zulfikar-ditya thanks for reply me
Yes, I know it has those filters. Actually, I use them quite often. |
Beta Was this translation helpful? Give feedback.
-
Ah my bad, |
Beta Was this translation helpful? Give feedback.
-
Any updates? |
Beta Was this translation helpful? Give feedback.
-
#162 stil in draft |
Beta Was this translation helpful? Give feedback.
-
Always get:
when i try to fill the options of the select-filter: options: ObjektGruppe::all(['id', 'gruppe_name_de'])->toArray() , it only works with: options: [8 => 'Gemälde', 22 => 'Porzellan',], how can i dynamicly fill the select-filter? |
Beta Was this translation helpful? Give feedback.
-
Use mapWithKeys() to flatten the array to key/value pairs:
|
Beta Was this translation helpful? Give feedback.
-
Thank you Daniel, that helped.
|
Beta Was this translation helpful? Give feedback.
-
I just found another problem, but maybe I'm just making a mistake? The SQL string that is created:
The problem is that the key is filtered as a string with LIKE:
So I don't get a unique group, it would have to be filtered for an integer:
how can I influence that? |
Beta Was this translation helpful? Give feedback.
-
Don't know about the LIKE, but this:
This will first load all records from the DB and than do the where() and sortBy() on the collection. You might want to do it the following way, which will do the filtering and ordering on the DB side:
|
Beta Was this translation helpful? Give feedback.
-
Unfortunately my English isn't the best :) the select component is filled and displayed correctly, but when I try to filter and select an element, the SQL string described above is generated internally by Splade.. I have no influence on that.. 1 painting If you now filter by |
Beta Was this translation helpful? Give feedback.
-
working fine for me, For now my only workaround is to make custom month & year filter, using spatie query builder |
Beta Was this translation helpful? Give feedback.
-
Hello, it would be great to have the possibility of adding custom filters in SpladeTable tables with a slot and thus adding these filters with the Splade form components.
For example:
So we could use these filters automatically by the key attributte or using the When function within the SpladeTable class
For exmaple:
By the way, excellent work!
Beta Was this translation helpful? Give feedback.
All reactions