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?
Solution:
I tried adding an ASSET_URL, but this didn't help.
Jump to solution
6 Replies
Dennis Koch
Dennis Koch3d ago
APP_URL should be enough. Did you set a ASSET_URL?
Adam Edible
Adam Edible3d ago
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');
Dennis Koch
Dennis Koch3d ago
Maybe try setting one
Solution
Adam Edible
Adam Edible3d ago
I tried adding an ASSET_URL, but this didn't help.
Adam Edible
Adam Edible3d ago
The (Laravel 11) solution is to add a trustProxies setting in /bootstrap/app.php:
->withMiddleware(function (Middleware $middleware) {
$middleware->trustProxies(at: '*');
})
->withMiddleware(function (Middleware $middleware) {
$middleware->trustProxies(at: '*');
})
Sources: * https://stackoverflow.com/a/77161158/15567698 * https://medium.com/@harrisrafto/securing-your-laravel-app-behind-load-balancers-mastering-the-trustproxies-middleware-5fd8c411b2d4
Stack 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…
Dennis Koch
Dennis Koch2d ago
Thanks for sharing
Want results from more Discord servers?
Add your server