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
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
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.