Filament base address setting?
I have set up laravel, livewire, and filament on github codespaces. things are mostly working.
However, when I visit the /admin page created by Filament the styling is off because it tries to get its CSS from an address of //localhost, whereas my site is on a Codespaces-generated address. I have changed .env's APP_URL to reflect the correct address, but the CSS source address doesn't change.
How do i tell Filament the domain to use as its base?
6 Replies
APP_URL
should be enough. Did you set a ASSET_URL
?I did not set an ASSET_URL
I have also verified that the Codespace URL is set correctly using
php artisan tinker
and env('APP_NAME');
Maybe try setting one
Solution
I tried adding an ASSET_URL, but this didn't help.
The (Laravel 11) solution is to add a
trustProxies
setting in /bootstrap/app.php
:
Sources:
* https://stackoverflow.com/a/77161158/15567698
* https://medium.com/@harrisrafto/securing-your-laravel-app-behind-load-balancers-mastering-the-trustproxies-middleware-5fd8c411b2d4Stack Overflow
Laravel route returns localhost despite I changed the env variable
I have APP_URL env variable set to domainname.com and I have url set to the same domain in config file as well. route('route.name') in artisan tinker returns the proper domain. yet when used in the
Medium
Securing Your Laravel App Behind Load Balancers: Mastering the Trus...
When running Laravel applications behind load balancers or reverse proxies, you might encounter issues with HTTPS detection or incorrect…
Thanks for sharing