Anish
Modify Export Action download URL link
Of course, what I am doing is not part of the set up. Basically my problem starts because I HAVE TO INSTALL laravel (and as a result filament) in a sub-directory. All the laravel routes, as well as the filament routes, I can modify by adding prefix (the name of the sub-directory). For filament panels, (I have 3 panels, I can do like for admin panel, similarly for others) and for laravel routes in web.php ( by grouping). The only thing which does not work is the exports (I don't have to use imports, so can't comment on that). Therefore, I have to resort to some way for adding the prefix for downloading). If I add these routes, it works (both export as well download). If I don't add, export happens but download fails. It is just that the web server is looking at a path which does not exist without the (sub-directory) prefix. At this moment my concern is that I need to attach some middleware so that unauthorized access is prevented. If I can find which middleware has this alias 'filament.actions', then I can directly attach it to the route, without going through the filament alias to have it working.
26 replies
Modify Export Action download URL link
This is the situation: I have added the routes in routes directory, in a file called web_filament.php. Then export and download works. The only downside at this moment is that the middlewares are commented out. If I don't comment out the middlewares, it doesn't work. Complains about middleware not being found.
But I have not edited any vendor file, what I am trying is to overwrite the download route by adding them in a file that I have control.
If I don't add the file, the export works. I can manually see the directory that the file has been created. There is database table, which also has the entry of the export. But the download is missing the subdirectory prefix, and hence the download fails.
I guess exports are not tied to any panel. In the panel you can add the prefix. If it is possible to add a prefix, then the hack is not required.
26 replies
Modify Export Action download URL link
OK, some progress:
Created a new routes file: web_filament.php and included it from web.php by
web_filament.php
This seems to get the export download urls to the correct path with the prefix of the sub-directory.
Can anyone point to me where these middlewares exist in the code base? When I try to include them, it gives me an error.
26 replies
How to close action confirmation modal after form validate fails?
I found a way to close the modal window - after the confirmation button is clicked. Here is my action
This seems to work for me, if it passes validation, goes through the action. If it fails validation, the modal window is closed and shows validation window.
Probably, naming could have been better! I guess that I should call it confirmedAction or something similar. I can put it in a trait and use it any place.
9 replies
DateConstraint
Thanks. But that's not using the DateConstraint. This is creating each filter separately. Then we can only use the "and" operations. I find the query builder is much more flexible. Of course, if I am unable to find a solution I will probably go back to a similar solution.
5 replies
Delete exported file
After checking the documentation, I found that there is a model
which holds the information about the export. One can define a hasMany relation on the User model to get the exports done by the User.
What I now need if there is any event that is dispatched when one clears the notifications. Then I can write a listener which will delete the file and also the corresponding database entry. I think this may be a Laravel Event, so I need to dig up the details on clearing database notifications.
9 replies