Laravel 5 - NotFoundHttpException in RouteCollection.php line 143

末鹿安然 提交于 2019-12-05 04:23:58

This is an issue with your routes.php declaration, make sure you have defined a route for the url you are trying to access. For example:

Route::get('/', 'PageController@index');

You can find more detailed syntax on the Laravel website: http://laravel.com/docs/5.1/routing

Edit:

Based on your routes.php - Change your Route to reflect as such:

Route::get('ecodryer', function () {
    return view('pages.site.main');
});

Sometimes this kind of problem comes with folder structure of the server such as url comes like localhost/project/. Try to create a virtual host for your local project. It's giving some extra benefits also. How to create a virtual host on wamp

For those who are getting similar error in laravel version 5.4.10(or 5.3 onwards as mentioned by @Chen Alon), routes.php file has been removed by default and if you still want to use it then just creating file is not enough. We need to include file in RouteServiceProvider.php file inside "map" function. Adding below line inside map function resolved the issue for me :

require app_path('Http/routes.php');

Sometimes this kind of problem comes with index.php. test your route by:

route/index.php

or

yourdomain/public/Route/index.php

you can remove index.php from URL by config apache and virtual host. this link can help you.

Nagarjuna
Route::get('hello', 'Hello@index');

It should be under /projectname/routes/web.php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!