snipe-it/routes/web/models.php

23 lines
1.3 KiB
PHP
Raw Normal View History

2016-12-15 06:11:03 -08:00
<?php
2021-06-10 13:17:14 -07:00
use App\Http\Controllers\AssetModelsController;
use App\Http\Controllers\BulkAssetModelsController;
use Illuminate\Support\Facades\Route;
// Asset Model Management
Route::group(['prefix' => 'models', 'middleware' => ['auth']], function () {
2021-06-10 13:17:14 -07:00
Route::get('{modelId}/clone', ['as' => 'clone/model', 'uses' => [AssetModelsController::class, 'getClone']]);
Route::post('{modelId}/clone', [AssetModelsController::class, 'postCreate']);
Route::get('{modelId}/view', ['as' => 'view/model', 'uses' => [AssetModelsController::class, 'getView']]);
Route::get('{modelID}/restore', ['as' => 'restore/model', 'uses' => [AssetModelsController::class, 'getRestore'], 'middleware' => ['authorize:superuser']]);
Route::get('{modelId}/custom_fields', ['as' => 'custom_fields/model', 'uses' => [AssetModelsController::class, 'getCustomFields']]);
Route::post('bulkedit', ['as' => 'models.bulkedit.index', 'uses' => [BulkAssetModelsController::class, 'edit']]);
Route::post('bulksave', ['as' => 'models.bulkedit.store', 'uses' => [BulkAssetModelsController::class, 'update']]);
Route::post('bulkdelete', ['as' => 'models.bulkdelete.store', 'uses' => [BulkAssetModelsController::class, 'destroy']]);
2016-12-15 06:11:03 -08:00
});
2021-06-10 13:17:14 -07:00
Route::resource('models', AssetModelsController::class, [
'middleware' => ['auth'],
'parameters' => ['model' => 'model_id'],
2016-12-15 06:11:03 -08:00
]);