auth pages not getting css in laravel
Stefan Bogdanescu
Founder & Senior Architect · 2026-06-29
Welcome to the world of Laravel development! As you continue to explore this powerful framework, you may encounter situations where certain pages don't display their respective styles properly. In particular, you might face issues with your login and register authentication pages not loading their respective CSS files. This blog post will guide you through a series of steps to help resolve these issues.
Prerequisites
To start troubleshooting this issue, make sure that your Laravel project is up to date with all the necessary packages and dependencies installed. Follow these basic steps: 1. Ensure you have the latest version of Composer installed by running `composer self-update` if needed. 2. Update your Laravel package using `composer update`. 3. Make sure that your npm dependencies are up to date with `npm update` or `npm install` if necessary. 4. Run the JavaScript development server (Node) using the command `npm run dev`. This will compile and watch for changes in your JavaScript files, including any stylesheets referenced within them. 5. Create a new Laravel application with authentication using the following commands:shell
php artisan ui vue
php artisan ui vue --authCommon Issues and Solutions
Now that you have your application up and running, let's address some common issues that may cause CSS not to load on auth pages. 1. Incorrect paths: Check the `app.blade.php` file located in the `resources/views` directory for any link tags with incorrect paths. Ensure the paths point to the correct assets folder within your application, such as `public/css` or `storage/css`.php
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<script src="{{ asset('js/app.js') }}" defer></script>php
{{ asset('/css/app.css') }}shell
php artisan route:clearphp
Ctrl + F5