'components', 'middleware' => ['auth']], function () { Route::get( '{componentID}/checkout', [Components\ComponentCheckoutController::class, 'create'] )->name('checkout/component'); Route::post( '{componentID}/checkout', [Components\ComponentCheckoutController::class, 'store'] )->name('checkout/component'); Route::get( '{componentID}/checkin/{backto?}', [Components\ComponentCheckinController::class, 'create'] )->name('checkout/component'); Route::post( '{componentID}/checkin/{backto?}', [Components\ComponentCheckinController::class, 'store'] )->name('checkout/component'); }); Route::resource('components', Components\ComponentsController::class, [ 'middleware' => ['auth'], 'parameters' => ['component' => 'component_id'], ]);