Downloading exported resources problem (problem with the auth guards)
I have a filament resource and I want to export then download them as a csv file. I set up everything as the filament documentation said so I can export the resources with a bulk action, then I get the notification where I can click the download csv button.
After I did these I got the error
With this modification it doesn't gives the error but the system opens a new window and redirects me to my filament dashboard instead of the csv gets downloaded.
Anyone have something in mind what can I do with this?
After I did these I got the error
Route [login] not defined. So I added this code to the web.php:With this modification it doesn't gives the error but the system opens a new window and redirects me to my filament dashboard instead of the csv gets downloaded.
Anyone have something in mind what can I do with this?
Solution
I managed to discover the problem and solved it!
The problem is that my filament app uses admin auth guard but the page where the download happens uses the user auth guard...
That was why the system wanted to log me in.
The work around (actually a hack) that I used is to redefine the download route in the
web.php
The problem is that my filament app uses admin auth guard but the page where the download happens uses the user auth guard...
That was why the system wanted to log me in.
The work around (actually a hack) that I used is to redefine the download route in the
web.php and use the appropriate guard.web.php