# Php routing is not working anymore

**URL:** <https://www.phphelp.com/t/php-routing-is-not-working-anymore/35569>\
**Category:** Beginners - Learning PHP\
**Created:** [July 26, 2023, 5:20am UTC](https://www.phphelp.com/t/php-routing-is-not-working-anymore/35569 "2023-07-26T05:20:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Sad\_Coder](https://www.phphelp.com/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@The\_Sad\_Coder](https://www.phphelp.com/u/The_Sad_Coder)\
**Post date:** [July 26, 2023, 5:20am UTC](https://www.phphelp.com/t/php-routing-is-not-working-anymore/35569/1 "2023-07-26T05:20:19Z")

</div>

```auto
<?php

use Illuminate\Support\Facades\Route;

Route::get('/', function () {

    return view('welcome');

});

Route::view("login",'user');

```

Above here are the routes that I have in web.php  
I try to type [http://127.0.0.1:8000/login](http://127.0.0.1:8000/login) into the url, but it keeps showing me a 404 not found page.

Even when I erase both the login and welcome routes, the welcome page in welcome.blade.php still appears, but once I rename welcome.blade.php into user.blade.php, I suddenly get an error.

I really need help on this issue because php routing used to work several weeks ago. Now that it wont work, this has been irritating me for several hours and I cant get the solution to the actual problem I’m facing.

---

<div class="post-metadata">

**Author:** ![katsry](https://www.phphelp.com/letter_avatar_proxy/v4/letter/k/2bfe46/32.png) [@katsry](https://www.phphelp.com/u/katsry)\
**Post date:** [July 28, 2023, 1:50pm UTC](https://www.phphelp.com/t/php-routing-is-not-working-anymore/35569/2 "2023-07-28T13:50:50Z")

</div>

Mostly routing issues in Laravel can occur due to a variety of reasons. Try steps to troubleshoot your issue:

**Clear Route Cache** : Laravel uses a caching mechanism for routes for better performance. If you’ve made changes to your `web.php` and they are not reflecting, it could be due to Laravel serving cached routes.  
You can clear the route cache by running this command:

```auto
php artisan route:clear

```

**Route List** : Try to check your list of routes using the `route:list` command to ensure your routes are being recognized by Laravel like so:

```auto
php artisan route:list

```

This will display a table of all registered routes in your application.

**Correct view file** : Ensure the view file `'user'` exists in your `resources/views` directory. Laravel will throw an error if it cannot find the view file associated with the route. The file should be named `user.blade.php` .

**Middleware** : Make sure you don’t have any middleware interfering with your routes. Middleware can be used to filter HTTP requests, so if you have a middleware attached that is causing the 404, you will need to check and address that issue also.

Check **Routing Order** , Laravel routes are read top to bottom, so if you have another route above that could also match `/login`, it will take precedence.

If none of these steps resolve the issue, it might be beneficial to look into your Laravel and server logs to identify if there’s any error or exception being thrown that could be causing this behavior. You can find Laravel’s log file in the `storage/logs` directory.

I think these steps will help you fix your troubling 404 not found page. Good Luck

---

<div class="post-metadata">

**Author:** ![benanamen](https://www.phphelp.com/user_avatar/www.phphelp.com/benanamen/32/287_2.png) [@benanamen](https://www.phphelp.com/u/benanamen)\
**Post date:** [July 29, 2023, 3:06pm UTC](https://www.phphelp.com/t/php-routing-is-not-working-anymore/35569/3 "2023-07-29T15:06:23Z")

</div>

Sounds like a cache problem. Make sure you disable cache while developing. Also, use the dev tools in your browser to disable browser cache and reload the page from the dev tools.

 ![devtools](https://www.phphelp.com/uploads/default/original/2X/d/d90c58ef30d806906c5e010532cc6fb515cb94d0.jpeg)
