Filament favicon is not embedded via https
Hello everyone.
I use the directive
->favicon(asset('/images/favicon.png'))
in my panel. When I call my panel in the local environment, the favicon is provided and included as expected.
On my prod server (on fly.io), however, the favicon is strangely included via Http, although the entire app is provided via HTTPS. All other assets (CSS, JS, laravel and filament) are included relative or via absolute path with HTTPS.
What is the reason for this and how can I change it? My browser understandably does not want to display a favicon integrated via a different protocol.
I have already tested re-build and filament upgrade. If I call asset('/images/favicon.png')
once on my fly.io instance via SSH in artisan tinker
, I also get the path including HTTPS.
If I see it correctly, the behavior occurred after the introduction of multi-tenancy. As a result, I had to reconfigure some routes. Could it be somehow related to this? And how can I debug or fix this correctly?
My routing configuration currently looks like this:
Many thanks in advance for your help!
Johannes NazarovSolution:Jump to solution
Try modifying the
ASSET_URL
env var. If that doesn't work try adding a force HTTPS in a service provider depending on your apps environment. https://stackoverflow.com/a/51819095Stack Overflow
How to force Laravel Project to use HTTPS for all routes?
I am working on a project that requires a secure connection.
I can set the route, uri, asset to use 'https' via:
Route::get('order/details/{id}', ['uses' => 'OrderController@details', 'as' =&g...
4 Replies
No one there who can help me? If I have found out correctly, the layout for this is under
vendor\filament\filament\resources\views\components\layout\base.blade.php
. The first lines (up to the integration of the favicon) look like this:
Does anyone know how I can find out which controller is used to call up this layout?Everything in panels uses that layout. I guess the more appropriate approach is why are you overriding paths?
Solution
Try modifying the
ASSET_URL
env var. If that doesn't work try adding a force HTTPS in a service provider depending on your apps environment. https://stackoverflow.com/a/51819095Stack Overflow
How to force Laravel Project to use HTTPS for all routes?
I am working on a project that requires a secure connection.
I can set the route, uri, asset to use 'https' via:
Route::get('order/details/{id}', ['uses' => 'OrderController@details', 'as' =&g...
I actually didn't realize that I was overwriting any paths. Where and how could that be?
Thank you, after I set
ASSET_URL
, the favicon is accessible. Also Facades\URL::forceScheme('https')
had no effect before.