Support the ongoing development of Laravel.io →
posted 10 years ago
Requests

in my routes.php

Route::controller('/admin','AdminController');
Route::controller('/admin/customers','\\Admin\\CustomersController');

but when i try to access localhost/admin/customers/create i get Controller method not found. (NotFoundHttpException) how can i make the secondary route to dispatch the other controller

Last updated 3 years ago.
0

so the solution i came with is to swap the controllers order in the routes.php file because laravel locates routes by array_first

0

Another way to resolve this, is by using route groups (http://laravel.com/docs/4.2/routing#route-prefixing).

0

Sign in to participate in this thread!

Eventy

Your banner here too?

elibyy elibyy Joined 3 Nov 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.