Reputation: 122
So I want to create admin page,
The result I want is like this
foo.com/admin/anthony
foo.com/admin/anthony/dologin
foo.com/admin/anthony/index
I tried using this routes
Route::any('admin/{username}', 'adminController@login'):
Route::any('admin/{username}/login', 'adminController@dologin');
I want to use every username parameter in admin page, but wont redeclare every page.
Upvotes: 1
Views: 37
Reputation: 131
you can create group of route in laravel, below is the example which might help you.
Route::group(['prefix' => 'admin/{username}'], function () {
Route::get('login', 'adminController@dologin');
});
Let me know if this doesn't work for you.
Upvotes: 0