laravel-backpack

CSS and JS assets not loaded at all in Laravel Backpack


After deploying my site to a fresh Laravel Forge server the JS and CSS files are not being loaded, they are not even being shown in the actually rendered HTML.

I've tried a few things already like running php artisan basset:check, which gives me three green DONEs. I've even tried running php artisan backpack:install. Locally everything works fine. Any help is much appreciated.

PHP VERSION: PHP 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 (cli) (built: Feb 15 2024 18:38:52) (NTS) Copyright (c) The PHP Group Zend Engine v4.3.3, Copyright (c) Zend Technologies with Zend OPcache v8.3.3-1+ubuntu22.04.1+deb.sury.org+1, Copyright (c), by Zend Technologies

LARAVEL VERSION:

BACKPACK PACKAGE VERSIONS:


Solution

  • This was resolved by using a different hostname. Where I previously used api-env.domain.com, I changed this to api.env.domain.com and updated the APP_URL accordingly. I'm not sure if the dash in the hostname is not supported, but this did the trick for me.