Cant i have two names with one route? Something like below:
Route::get('/', 'Admin\HomeController@index')->name(['admin.home', 'planner.home.index']);
Thanks!
This works only if you need the name, not the URL, although it's tricky and sloppy.
Route::get('/', 'Admin\HomeController@index')->name('admin.home');
Route::get('/2', function() {
return redirect()->route('admin.home')
})->name('planner.home.index');
So if you use route('admin.home')
or route('planner.home.index')
it will redirects you to the method index
in your HomeController
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With