Vinny
Prevent select option re-rendering in SelectInput
Hi, I am using a SelectInput that looks something like this
I am using this in a Wizard and my problem is that I have about 6-7 selects that rely on DB queries. This causes issues anytime I go between pages in the Wizard and the form ends up becoming very slow because it runs the DB query for the select options if there is any kind of validation, live state update, or change in wizard step.
I would like to make it so that I only have to query the DB once for the select options, on page load.
I could store the select options in public variable on the Form and call the query only once, in the mount method, and passing the variable as the options parameter in the selects. but I was wondering if there was a different way to do this where I could tell the Select component to not re-run the options query after the initial page load.
4 replies
Table search spinner never stops loading
I am using table builder with a few searchable columns. Whenever I enter a search and clear it, the search spinner loads forever even if the search itself finishes executing.
I have included a video of the problem below.
This is how my component looks like:
There are no console or server errors occurring.
2 replies
Table Builder + Scout: Search Result Order
Currently, if I use https://filamentphp.com/docs/3.x/tables/advanced#searching-records-with-laravel-scout to integrate table builder with scout, the search results are ordered by the id number of the record, meaning that the most relevant search result is often not at the top because it has a larger id value.
I want the search results in the table builder to be ordered by order that scout returns. What would be the best way to approach this?
For reference: this is the query that table builder tries to execute. When the search bar is filled, I don't want the results to be ordered by id, but by the order that scout returns.
11 replies
Issues with using custom JS scripts
Hello, I am using table builder v3 and I am having 3 main problems when trying to use some custom Alpine javascript with filament.
1. If the body in my app.blade.php looks like this (below) then when I try to use the search feature on the table builder, I get no errors in the console but the animation "breaks" where the spinner on the search bar of the table spins infinitely even if the search has finished running.
2. The issue fixes itself if the body part in my app.blade.php file looks like this (below). If I do this, I get no issues with the table animations but my app.js script doesn't work correctly (eg: it cannot load $persist from alpine through livewire because the @livewireScriptConfig tag is missing). This also gives me errors in the console where it says that I have multiple instances of livewire and alpine running.
3. I could remove the custom script tag but then I lose all javascript functionality within my page.
Here is my app.js script:
6 replies
Is there a way to auto-scrub model attributes that aren't being used?
Hello, according to https://filamentphp.com/docs/2.x/admin/resources/security, filament automatically exposes all model attributes unless they are protected by the $visible or $hidden model attributes. These exposed attributes are accessible through the console under window.livewire
Is there a way to make it so that filament automatically scrubs model attributes that aren't being used in the view/edit form? I understand that, according to the documentation, this may affect the functionality of dynamic addition/removal of form fields for the model attributes that are auto-scrubbed, but I am willing to take that trade for my use-case.
Thank you.
4 replies
Is there a way to display no records in the list view by default and only see records when searchin?
I want to make it so that:
User accesses list records page -> User sees 0 records by default -> User starts seeing records for search results once they type something in the search bar
Thank you.
4 replies