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'],
|
2021-06-10 13:15:52 -07:00
|
|
|
'parameters' => ['kit' => 'kit_id'],
|
2018-10-19 07:30:25 -07:00
|
|
|
]);
|
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function () {
|
2018-10-19 07:30:25 -07:00
|
|
|
|
2021-06-10 13:15:52 -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
|
|
|
// ]
|
|
|
|
// );
|
2021-06-10 13:15:52 -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
|
|
|
]
|
|
|
|
);
|
2021-06-10 13:15:52 -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
|
|
|
]
|
|
|
|
);
|
2021-06-10 13:15:52 -07:00
|
|
|
|
|
|
|
Route::get('licenses/{license_id}/edit',
|
2019-01-27 12:19:24 -08:00
|
|
|
[
|
|
|
|
'as' => 'kits.licenses.edit',
|
2021-06-10 13:17:14 -07:00
|
|
|
'uses' => [Kits\PredefinedKitsController::class, 'editLicense'],
|
2021-06-10 13:15:52 -07:00
|
|
|
|
2019-01-27 12:19:24 -08:00
|
|
|
]
|
|
|
|
);
|
2018-10-19 07:30:25 -07:00
|
|
|
|
2021-06-10 13:15:52 -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
|
|
|
]
|
|
|
|
);
|
2019-01-27 12:19:24 -08:00
|
|
|
|
|
|
|
// Models
|
2021-06-10 13:15:52 -07:00
|
|
|
|
|
|
|
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'],
|
2021-06-10 13:15:52 -07:00
|
|
|
'parameters' => [2 => 'kit_id', 1 => 'model_id'],
|
2018-10-19 07:30:25 -07:00
|
|
|
]
|
|
|
|
);
|
2021-06-10 13:15:52 -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'],
|
2021-06-10 13:15:52 -07:00
|
|
|
|
2018-10-31 06:06:38 -07:00
|
|
|
]
|
|
|
|
);
|
2018-10-19 07:30:25 -07:00
|
|
|
|
2021-06-10 13:15:52 -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
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2019-01-27 12:19:24 -08:00
|
|
|
// Consumables
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::put('consumables/{consumable_id}',
|
2019-01-27 12:19:24 -08:00
|
|
|
[
|
|
|
|
'as' => 'kits.consumables.update',
|
2021-06-10 13:17:14 -07:00
|
|
|
'uses' => [Kits\PredefinedKitsController::class, 'updateConsumable'],
|
2021-06-10 13:15:52 -07:00
|
|
|
'parameters' => [2 => 'kit_id', 1 => 'consumable_id'],
|
2019-01-27 12:19:24 -08:00
|
|
|
]
|
|
|
|
);
|
2021-06-10 13:15:52 -07:00
|
|
|
|
|
|
|
Route::get('consumables/{consumable_id}/edit',
|
2019-01-27 12:19:24 -08:00
|
|
|
[
|
|
|
|
'as' => 'kits.consumables.edit',
|
2021-06-10 13:17:14 -07:00
|
|
|
'uses' => [Kits\PredefinedKitsController::class, 'editConsumable'],
|
2021-06-10 13:15:52 -07:00
|
|
|
|
2019-01-27 12:19:24 -08:00
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::delete('consumables/{consumable_id}',
|
2019-01-27 12:19:24 -08:00
|
|
|
[
|
|
|
|
'as' => 'kits.consumables.detach',
|
2021-06-10 13:17:14 -07:00
|
|
|
'uses' => [Kits\PredefinedKitsController::class, 'detachConsumable'],
|
2019-01-27 12:19:24 -08:00
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
// Accessories
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::put('accessories/{accessory_id}',
|
2019-01-27 12:19:24 -08:00
|
|
|
[
|
|
|
|
'as' => 'kits.accessories.update',
|
2021-06-10 13:17:14 -07:00
|
|
|
'uses' => [Kits\PredefinedKitsController::class, 'updateAccessory'],
|
2021-06-10 13:15:52 -07:00
|
|
|
'parameters' => [2 => 'kit_id', 1 => 'accessory_id'],
|
2019-01-27 12:19:24 -08:00
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::get('accessories/{accessory_id}/edit',
|
2019-01-27 12:19:24 -08:00
|
|
|
[
|
|
|
|
'as' => 'kits.accessories.edit',
|
2021-06-10 13:17:14 -07:00
|
|
|
'uses' => [Kits\PredefinedKitsController::class, 'editAccessory'],
|
2021-06-10 13:15:52 -07:00
|
|
|
|
2019-01-27 12:19:24 -08:00
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
Route::delete('accessories/{accessory_id}',
|
2019-01-27 12:19:24 -08:00
|
|
|
[
|
|
|
|
'as' => 'kits.accessories.detach',
|
2021-06-10 13:17:14 -07:00
|
|
|
'uses' => [Kits\PredefinedKitsController::class, 'detachAccessory'],
|
2019-01-27 12:19:24 -08:00
|
|
|
]
|
|
|
|
);
|
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
|
|
|
]
|
|
|
|
);
|
2021-06-10 13:15:52 -07:00
|
|
|
}); // kits
|