Closed doncadavona closed 7 months ago
Hey @doncadavona
Can you check APP_URL
in env. It should be http://laravel-10.local
in your case.
Let me know if the problem is not solved.
@karandatwani92 ,
Yes, my APP_URL
is http://laravel-10.local
. I had several Laravel installations similar to this setup since I raised this, and I encounter the same issue on all of them.
Sorry for my late reply. My regards.
I have resolved the issue by doing the following:
php artisan basset:clear
php artisan storage:unlink
php artisan storage:link
php artisan basset:install
sudo chown -R $USER:www-data storage
sudo chmod -R 775 storage
Then reloading the site in the browser.
This is perhaps caused by permissions in the filesystem and the sequence of commands are sometimes neglected but vital.
I am not sure why Basset has not thrown any errors. php artisan basset:check
has no errors.
Issue:
The assets are not loaded correctly due to wrong paths when in local DNS:
When I run
php artisan basset
, no errors are reported.In my example recreation, I have Laravel 10 with Backpack 6 installed and served in Nginx on my local machine.
I pointed my localhost to
laravel-10.local
in/etc/hosts
:My Nginx properly configured to reverse-proxy this local domain to its repository in
/var/www/laravel-10
.My
APP_ENV
islocal
.When I run the app via
php artisan serve
, the assets are correctly loaded.But via a reverse proxy (Nginx) in a local machine, the assets are loaded like so, which is incorrect: