snipe-it/routes/web/kits.php

136 lines
3.6 KiB
PHP
Raw Normal View History

2018-10-19 07:30:25 -07:00
<?php
2021-06-10 13:17:14 -07:00
use App\Http\Controllers\Kits;
use Illuminate\Support\Facades\Route;
2018-10-19 07:30:25 -07:00
// Predefined Kit Management
2021-06-10 13:17:14 -07:00
Route::resource('kits', Kits\PredefinedKitsController::class, [
2018-10-19 07:30:25 -07:00
'middleware' => ['auth'],
'parameters' => ['kit' => 'kit_id'],
2018-10-19 07:30:25 -07:00
]);
Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function () {
2018-10-19 07:30:25 -07:00
// Route::get('licenses',
2018-10-31 06:06:38 -07:00
// [
// 'as' => 'kits.licenses.index',
2021-06-10 13:17:14 -07:00
// 'uses' => [Kits\PredefinedKitsController::class, 'indexLicenses'],
2018-10-31 06:06:38 -07:00
// ]
// );
Route::post('licenses',
2018-10-19 07:30:25 -07:00
[
'as' => 'kits.licenses.store',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'storeLicense'],
2018-10-19 07:30:25 -07:00
]
);
Route::put('licenses/{license_id}',
2018-10-19 07:30:25 -07:00
[
'as' => 'kits.licenses.update',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'updateLicense'],
2018-10-19 07:30:25 -07:00
]
);
Route::get('licenses/{license_id}/edit',
[
'as' => 'kits.licenses.edit',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'editLicense'],
]
);
2018-10-19 07:30:25 -07:00
Route::delete('licenses/{license_id}',
2018-10-19 07:30:25 -07:00
[
2018-10-31 06:06:38 -07:00
'as' => 'kits.licenses.detach',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'detachLicense'],
2018-10-19 07:30:25 -07:00
]
);
// Models
Route::put('models/{model_id}',
2018-10-19 07:30:25 -07:00
[
'as' => 'kits.models.update',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'updateModel'],
'parameters' => [2 => 'kit_id', 1 => 'model_id'],
2018-10-19 07:30:25 -07:00
]
);
Route::get('models/{model_id}/edit',
2018-10-31 06:06:38 -07:00
[
'as' => 'kits.models.edit',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'editModel'],
2018-10-31 06:06:38 -07:00
]
);
2018-10-19 07:30:25 -07:00
Route::delete('models/{model_id}',
2018-10-19 07:30:25 -07:00
[
2018-10-31 06:06:38 -07:00
'as' => 'kits.models.detach',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'detachModel'],
2018-10-19 07:30:25 -07:00
]
);
// Consumables
Route::put('consumables/{consumable_id}',
[
'as' => 'kits.consumables.update',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'updateConsumable'],
'parameters' => [2 => 'kit_id', 1 => 'consumable_id'],
]
);
Route::get('consumables/{consumable_id}/edit',
[
'as' => 'kits.consumables.edit',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'editConsumable'],
]
);
Route::delete('consumables/{consumable_id}',
[
'as' => 'kits.consumables.detach',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'detachConsumable'],
]
);
// Accessories
Route::put('accessories/{accessory_id}',
[
'as' => 'kits.accessories.update',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'updateAccessory'],
'parameters' => [2 => 'kit_id', 1 => 'accessory_id'],
]
);
Route::get('accessories/{accessory_id}/edit',
[
'as' => 'kits.accessories.edit',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'editAccessory'],
]
);
Route::delete('accessories/{accessory_id}',
[
'as' => 'kits.accessories.detach',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\PredefinedKitsController::class, 'detachAccessory'],
]
);
2018-11-13 09:33:32 -08:00
Route::get('checkout',
[
'as' => 'kits.checkout.show',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\CheckoutKitController::class, 'showCheckout'],
2018-11-13 09:33:32 -08:00
]
);
Route::post('checkout',
[
'as' => 'kits.checkout.store',
2021-06-10 13:17:14 -07:00
'uses' => [Kits\CheckoutKitController::class, 'store'],
2018-11-13 09:33:32 -08:00
]
);
}); // kits