snipe-it/routes/web/components.php
snipe 5e488bd81f Handle components route names
Signed-off-by: snipe <snipe@snipe.net>
2022-08-01 16:10:39 -07:00

34 lines
987 B
PHP

<?php
use App\Http\Controllers\Components;
use Illuminate\Support\Facades\Route;
// Components
Route::group(['prefix' => 'components', 'middleware' => ['auth']], function () {
Route::get(
'{componentID}/checkout',
[Components\ComponentCheckoutController::class, 'create']
)->name('component.checkout.show');
Route::post(
'{componentID}/checkout',
[Components\ComponentCheckoutController::class, 'store']
)->name('component.checkout.store');
Route::get(
'{componentID}/checkin/{backto?}',
[Components\ComponentCheckinController::class, 'create']
)->name('component.checkin.show');
Route::post(
'{componentID}/checkin/{backto?}',
[Components\ComponentCheckinController::class, 'store']
)->name('components.checkin.store');
});
Route::resource('components', Components\ComponentsController::class, [
'middleware' => ['auth'],
'parameters' => ['component' => 'component_id'],
]);