Level 50
Depends on the definition of "clean".
I wouldn't get the vacuum out for those two lines as they seem pretty clean.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
https://laracasts.com/series/laravel-from-scratch-2018/episodes/27
is there a cleaner way to do this?
Route::resource('projects', 'ProjectsController')->except(['show', 'create', 'index'])->middleware('can:update,project');
Route::resource('projects', 'ProjectsController')->only(['show', 'create', 'index']);
Depends on the definition of "clean".
I wouldn't get the vacuum out for those two lines as they seem pretty clean.
Please or to participate in this conversation.