1
votes

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.

1

1 Answers

0
votes

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.