snipe-it/routes/web/kits.php
Dmitrii Minaev e01e0c5596 Add licenses, accessories and consumables table presenters app\Presenters\PredefinedKitPresenter.php resources\views\partials\bootstrap-table.blade.php
Add refresh licenses, accessories and consumables tables refresh when add a new element resources\assets\js\snipeit_modals.js
Some design fixes resources\views\kits\edit.blade.php
Add default value to form (template) resources\views\modals\kit-model.blade.php
New routes for kit accessories and kit consumables routes\api.php
New routes for kit models, kit accessories and kit consumables routes\web\kits.php
New templates
2019-01-27 23:19:24 +03:00

160 lines
3.9 KiB
PHP

<?php
// Predefined Kit Management
Route::resource('kits', 'Kits\PredefinedKitsController', [
'middleware' => ['auth'],
'parameters' => ['kit' => 'kit_id']
]);
Route::group([ 'prefix' => 'kits/{kit_id}', 'middleware' => ['auth'] ], function () {
// Route::get('licenses',
// [
// 'as' => 'kits.licenses.index',
// 'uses' => 'Kits\PredefinedKitsController@indexLicenses',
// ]
// );
Route::post('licenses',
[
'as' => 'kits.licenses.store',
'uses' => 'Kits\PredefinedKitsController@storeLicense',
]
);
Route::put('licenses/{license_id}',
[
'as' => 'kits.licenses.update',
'uses' => 'Kits\PredefinedKitsController@updateLicense',
]
);
Route::get('licenses/{license_id}/edit',
[
'as' => 'kits.licenses.edit',
'uses' => 'Kits\PredefinedKitsController@editLicense',
]
);
Route::delete('licenses/{license_id}',
[
'as' => 'kits.licenses.detach',
'uses' => 'Kits\PredefinedKitsController@detachLicense',
]
);
// Models
Route::post('models',
[
'as' => 'kits.models.store',
'uses' => 'Kits\PredefinedKitsController@storeModel',
]
);
Route::put('models/{model_id}',
[
'as' => 'kits.models.update',
'uses' => 'Kits\PredefinedKitsController@updateModel',
'parameters' => [2 => 'kit_id', 1 => 'model_id']
]
);
Route::get('models/{model_id}/edit',
[
'as' => 'kits.models.edit',
'uses' => 'Kits\PredefinedKitsController@editModel',
]
);
Route::delete('models/{model_id}',
[
'as' => 'kits.models.detach',
'uses' => 'Kits\PredefinedKitsController@detachModel',
]
);
// Consumables
Route::post('consumables',
[
'as' => 'kits.consumables.store',
'uses' => 'Kits\PredefinedKitsController@storeConsumable',
]
);
Route::put('consumables/{consumable_id}',
[
'as' => 'kits.consumables.update',
'uses' => 'Kits\PredefinedKitsController@updateConsumable',
'parameters' => [2 => 'kit_id', 1 => 'consumable_id']
]
);
Route::get('consumables/{consumable_id}/edit',
[
'as' => 'kits.consumables.edit',
'uses' => 'Kits\PredefinedKitsController@editConsumable',
]
);
Route::delete('consumables/{consumable_id}',
[
'as' => 'kits.consumables.detach',
'uses' => 'Kits\PredefinedKitsController@detachConsumable',
]
);
// Accessories
Route::post('accessories',
[
'as' => 'kits.accessories.store',
'uses' => 'Kits\PredefinedKitsController@storeAccessory',
]
);
Route::put('accessories/{accessory_id}',
[
'as' => 'kits.accessories.update',
'uses' => 'Kits\PredefinedKitsController@updateAccessory',
'parameters' => [2 => 'kit_id', 1 => 'accessory_id']
]
);
Route::get('accessories/{accessory_id}/edit',
[
'as' => 'kits.accessories.edit',
'uses' => 'Kits\PredefinedKitsController@editAccessory',
]
);
Route::delete('accessories/{accessory_id}',
[
'as' => 'kits.accessories.detach',
'uses' => 'Kits\PredefinedKitsController@detachAccessory',
]
);
Route::get('checkout',
[
'as' => 'kits.checkout.show',
'uses' => 'Kits\CheckoutKitController@showCheckout',
]
);
Route::post('checkout',
[
'as' => 'kits.checkout.store',
'uses' => 'Kits\CheckoutKitController@store',
]
);
}); // kits