1

When I use Laravel development server (php artisan serve) all is working but when I want to use xampp server I get error 404 in laravel auth login and register pages

I use href="{{ asset('css/app.css') }}"

When I use 127.0.0.1:8000/login all is working:

screenshot of working login form

But when I use xampp server, for example blog.test/login, it is not working:

error messages

Scaramouche
  • 3,188
  • 2
  • 20
  • 46
  • please check below code – sajjad Jan 21 '20 at 21:50
  • Does this answer your question? [Laravel 6.0.3 Not Loading Key Resources App.js or App.css 404 Not Found](https://stackoverflow.com/questions/57940718/laravel-6-0-3-not-loading-key-resources-app-js-or-app-css-404-not-found) – Calos Jan 22 '20 at 01:05

5 Answers5

3

in laravel 6 and after version you must install ui . run below code in artisan

composer require laravel/ui --dev

php artisan ui bootstrap

php artisan ui bootstrap --auth

npm install 

npm run dev
sajjad
  • 477
  • 5
  • 12
1

Use:

{{asset('assets_file.css')}}
Louis B
  • 306
  • 5
  • 18
  • I use it. When I use http://127.0.0.1:8000/login all is working but when I use xampp server for example http://blog.test/login not working – Elmira Balasanyan Jan 21 '20 at 18:19
  • While this code snippet may solve the problem, [including an explanation](https://meta.stackoverflow.com/q/392712/2648551) really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion. Please also try not to crowd your code with explanatory comments, as this reduces the readability of both the code and the explanations! – colidyre Jan 21 '20 at 22:20
1

I think your css file link is not properly written

use <a href = "{{asset('//your public path location')}}" />

Rezwan
  • 58
  • 7
0
php artisan sweetalert:publish
Abdulmajeed
  • 552
  • 7
  • 8
0

Check your path and folder exist on location i.e. check for css and js files as below, if you configured as public folder then in index.php file root must be

$app = require_once __DIR__.'/../bootstrap/app.php';

check files are present physically on public folder or if you configure without public folder as below,

$app = require_once __DIR__.'/bootstrap/app.php';

check your files exist on root ( files css and js files ) not in public folder and most importantly check physically files are uploaded.

hope this will work for you!

Martin Brisiak
  • 3,872
  • 12
  • 37
  • 51