Laravel not getting the APP_URL parameter when we try to use url function inside the blade file
06:41 29 Jun 2023

I'm facing a weird situation, just look at the following code in a blade file, and the output of it

Blade

{{ url('xero_invoice_authorised') }}
config app url - {{ config('app.url') }}
env app url - {{ env('APP_URL') }}

Output

http://xxxx/xero_invoice_authorised
config app url - https://xxxx/
env app url - https://xxxx/

url() is returning the URL as http: but it should be https:.

The system is inside a docker container.

I have run all commands to clear the cache, view, routes, and even ran optimize command.

Can anyone suggest to me what's wrong with my configuration? or any method to rectify this issue?

I need {{ url('') }} to return the APP_URL in the .env file.

laravel laravel-blade .env laravel-config