Robert Mann
FileUpload access the file before hitting submit?
When you drag and drop or browse for a file and select a file it uploads correct?
Do we have access to that file before we hit the submit button? What I want to do is take the file and process it and fill in form fields from data from that file without having to hit submit and take the user to another form if that makes sense. I know that afterStateUpdated fires after the file is 100% uploaded I guess my question is do we have access to that file on the server side at that point or is there another event I can use?
Do we have access to that file before we hit the submit button? What I want to do is take the file and process it and fill in form fields from data from that file without having to hit submit and take the user to another form if that makes sense. I know that afterStateUpdated fires after the file is 100% uploaded I guess my question is do we have access to that file on the server side at that point or is there another event I can use?
2 replies
getHeaderAction action visible does not refresh until second click
Using panel builder I have a Actions\Action setup in the ListModels.php that sets a database field in all records outstanding to a date.
The visible() checks for any records that don't have a date and if there are none it is not visible.
It stays visible until the second click. Here is the code and I did pair it down.
So you click the first action download and it updates a models datetime and downloads a file. Then it uses that datetime field to determine if it should be visible. Once there are no more models without that datetime null it should hide the first download action and then show the second download_success action.
What happens is this. You click the first action and it does the work. But the visibility of both actions stays the same. Then if you click the first actions button again it changes from the first action being visible to the second action being visible which is what it should do with the first click.
So it is like livewire is not updating the visibility. I have this working perfectly in Tables\Actions\Action with the ModelResource.php table actions. When you click the first action there it works perfect.
Am I missing some sort of livewire method?
1 replies
Filament form redirect to view on submit
I am using filament both as a panel and as standalone forms for public facing. I have a standalone form that I would like to redirect the user to a regular Laravel view with a summary. I may be missing something really simple here but I can't seem to figure out how to do this or if there would be a better way?
2 replies
Does FileUpload have a started/finished upload event of any kind?
I would like to disable the submit button until the upload has completed. I looked through the documentation and did not see any type of event that happens during the file upload process.
5 replies
I am using Laravel Scout with Meilisearch issue with Default Sortting
I use Laravel Scout and Meilisearch and when I get results from Meilisearch they are in order of preference. The issue is the the table is automatically setting the defaultSort('primary_key', 'DESC') even though I am not specifying that.
I do not have a defaultSort() on the table and the primary key is not even present on the table.
So I will give an example. I have several columns that are sortable but when you search on a fresh load of the table I need it to not have any columns sorted. The reason is meilisearch responds with keys (primary keys) and then does the whereIn('key', Model::search($search)->keys()) and that returns the keys in a specific order that needs to be reflected on the table.
Meilisearch returns more results than what is found because it does typo results as well. So while the result is there it is not at the top of the table like it should be because it is being sorted by the primary key automatically.
I hope that made sense. If not let me know and I will try to explain it better.
Basically I need to know is there a way to force NO default sort? I read through multiple posts and one talked about removing sortable from all the table columns but that is not what I want either. I would like for them to be able to sort if they need too but the default sort to be nothing at the start.
3 replies
Global search on 1.5 mil records.
I have a mysql database with 1.5 million records in a table. When implementing a global search in filamentphp and checking the query it uses something like
and that causes mysql not to use indexes and the query takes 3.7 seconds on average. Is there a way to turn that functionality off either in Laravel or Filamentphp? I would be fine with
which would use indexes and the query takes < 100ms. OR is there a better solution for this?
2 replies
Public form theme or custom css?
I am working on creating a public form. I have panels as well in the same application. This form has a specific way it needs to be laid out and the standard filament css just won't work here. Is there an easy way to create a reusable theme that I can apply only to these public forms or if it is even possible should I simply remove the @vite('resources/css/app.css') from the layout file and use my own CSS? Or will that break other functionality?
17 replies