Laravel 5 - NotFoundHttpException in RouteCollection.php line 143 Laravel 5 - NotFoundHttpException in RouteCollection.php line 143 laravel laravel

Laravel 5 - NotFoundHttpException in RouteCollection.php line 143


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');