Skip to content

Refactor to Route::controller groups #62

Open
@jasonmccreary

Description

@jasonmccreary

Laravel 9 introduced Route::controller groups (may have been back ported to Laravel 8). This task would refactor routes to use the new Route::controller() groupings.

Before

Route::get('/photos', [PhotoController::class, 'index'])->name('photos.index');
Route::get('/photos/{id}', [PhotoController::class, 'show'])->name('photos.show');

After

Route::controller(PhotoController::class)->group(function () {
    Route::get('/photos', 'index')->name('photos.index');
    Route::get('/photos/{id}', 'show')->name('photos.show');
});

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions