How to shorten this laravel route, I am trying to avoid to write code multiple times for one route.
Route::group(['domain' => 'maindomain.com'], function()
{
Route::get('/signup', function () {
return view('app.signup');
});
Route::post('signup', 'UsersController@saveSignupStepOne');
Route::get('/signup2', function () {
return view('app.signup2');
});
Route::post('signup2', 'UsersController@saveSignupStepSecond');
});
Route::group(['domain' => 'subdomain.maindomain.com'], function()
{
Route::get('/signup', function () {
return view('app.signup');
});
Route::post('signup', 'UsersController@saveSignupStepOne');
Route::get('/signup3', function () {
return view('app.signup3');
});
Route::post('signup3', 'UsersController@saveSignupStepThird');
});
Where common code is
Route::get('/signup', function () {
return view('app.signup');
});
Route::post('signup', 'UsersController@saveSignupStepOne');
I have made like below code but how to use in above route ?
$commonRoute = function(){
Route::get('/signup', function () {
return view('app.signup');
});
Route::post('signup', 'UsersController@saveSignupStepOne');
}