I create a fresh laravel 5 project and the routes file is as bellow.
Route::get('/', function () {
return view('welcome');
});
When I access it with http://localhost/mysite/laravel/public/ it works fine and goes to the welcome page. But when I modify the route as bellow and access it as http://localhost/mysite/laravel/public/blogs an error occurs.
Route::get('/blogs', function () {
return view('welcome');
});
Error:
NotFoundHttpException in RouteCollection.php line 161:
in RouteCollection.php line 161
at RouteCollection->match(object(Request)) in Router.php line 821
at Router->findRoute(object(Request)) in Router.php line 691
at Router->dispatchToRoute(object(Request)) in Router.php line 675
at Router->dispatch(object(Request)) in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 132
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 54
The project is a fresh one and I didn't change any file except the route. What is the reason for this error? I am using laravel 5.x and XAMPP. I read all the similar questions in stackoverflow but still I couldn't find an answer please help.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire