Steve
Steve

Reputation: 1046

NotFoundHttpException in RouteCollection.php

I use Laravel 5!

In my routes.php file I have the following request to check for all admin requests in the URL:

 if (Request::is('admin/*'))
 {
     require __DIR__.'/admin_routes.php';
 }

In that case in the corresponding admin_routes.php file it should return the correct controller where I have:

 Route::group(['prefix' => 'admin', 'middleware' => 'auth'], function() {

     #Admin Dashboard
     Route::get('dashboard', 'Admin\DashboardController@index');
 }); 

I cleared already the route cache (php artisan route:clear) , but I get the error message: NotFoundHttpException in RouteCollection.php line 145 . Any ideas what could be wrong? Thank you

Upvotes: 1

Views: 6864

Answers (1)

Matthias Loibl
Matthias Loibl

Reputation: 873

Put all your routes in one file, since it is documentation for others aswell. This should be kept as simple as it can be.

Then use Route Groups.

Why would you need to include other files?

Upvotes: 3

Related Questions