Level 41
Personally, I prefer the first option. I think it looks cleaner and is easier to understand.
Ultimately though, it doesn't matter. Just go with the option that you like.
1 like
Summer Sale! All accounts are 50% off this week.
Hi
I'm new to Laravel and am trying to make sure I start with good habits.
When writing routes I'd like to know which method people prefer and if there are what the pros and cons of each way. (Is there another way?)
Route::get('/home', 'Backend\HomeController@index')->name('home');
Route::get('/home', [
'as' => 'home',
'uses' => 'Backend\HomeController@index'
]);
Thanks
Please or to participate in this conversation.