Adarsh Sojitra
Adarsh Sojitra

Reputation: 2199

Why Suddenly Laravel started showing 'page not found' error?

I was working on my project and suddenly Laravel started showing Sorry, the page you are looking for could not be found. error. Here is how my web.php, CarController.php and view's location looks like.

web.php

Route::group(['middleware'=>'auth'],function(){
    Route::get('cars/create',"CarController@create");
}

CarController.php

<?php

namespace App\Http\Controllers;

use App\Car;
use Illuminate\Http\Request; 
use Auth;

class CarController extends Controller
{
     public function create()
     {
         return view('cars.create');
     }
}

View cars.create exist at /resources/views/cars/create.blade.php.

I don't know what caused this error but It's really irritating. I think this error came into existence because I had created one model named Request which might conflict with the actual Request class made by Laravel.

But, As soon as I saw the error, I deleted that Model including migration and controller. But still, the error is there. Any help would be appreciated!

Upvotes: 2

Views: 449

Answers (2)

Constantine
Constantine

Reputation: 367

Are you logged in ?? when you're trying to get the route?? usually what happens is the session expires after sometime.

Upvotes: 0

Sohel0415
Sohel0415

Reputation: 9853

Route::get('cars',"CarController@index");
Route::get('cars/{car}',"CarController@show");///remove this route definition or keep it at the end of your route file

Upvotes: 2

Related Questions