Shift with red gradient lettering
Loading navigation...

Expand resource routes

Premium
Laravel
Experimental

Separate routes registered with resource and apiResource methods into their individual routes.

Before

Route::resource('photos', PhotoController::class);

After

Route::get('photos', [PhotoController::class, 'index'])->name('photos.index');
Route::get('photos/create', [PhotoController::class, 'create'])->name('photos.create');
Route::post('photos/create', [PhotoController::class, 'store'])->name('photos.store');
Route::get('photos/{photo}', [PhotoController::class, 'show'])->name('photos.show');
Route::get('photos/{photo}/edit', [PhotoController::class, 'edit'])->name('photos.edit');
Route::match(['PUT', 'PATCH'], 'photos/{photo}', [PhotoController::class, 'update'])->name('photos.update');
Route::delete('photos/{photo}', [PhotoController::class, 'destroy'])->name('photos.destroy');

← Back to the Workbench Tasks