I have a homegrown, Laravel 5.1 base application on top of which I build specific applications. The base application uses a named route for login, naturally called "login", which listens for GET /login.
In one of my specific applications, I attempted to overload that route to send the requests to a different controller. It seemed to work for a while, but then it started going to the base application's controller again. I'm sure I changed something to break it, but the problem is that I can't figure out how to fix it again.
My base application routes are all defined in app/Http/Routes/core.php. The relevant route:
Route::get('login', [
'as' => 'login',
'uses' => '\MyVendor\Core\Http\Controllers\AuthController@getLogin'
]);
My specific application routes are defined in app/Http/Routes/application.php. The relevant route:
Route::get('login', [
'as' => 'login',
'uses' => 'App\AuthController@getLogin'
]);
My app/Http/routes.php adds these routes like this:
require 'Routes/application.php';
require 'Routes/core.php';
No matter which order I require those files, the core route is the one that goes into effect.
My goal is to have the routes defined in 'Routes/application.php' take precedence over any "conflicting" routes in 'Routes/core.php'. Is this possible? How?
EDIT: I just switched this back to have 'core.php' required first, and now the request is going to the right controller. I'm positive this wasn't working a minute ago...
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1Up10Zh
via IFTTT
Aucun commentaire:
Enregistrer un commentaire