snipe-it/routes/web/hardware.php

191 lines
6.4 KiB
PHP
Raw Normal View History

<?php
2021-06-10 13:17:14 -07:00
use App\Http\Controllers\AssetMaintenancesController;
use App\Http\Controllers\Assets;
use Illuminate\Support\Facades\Route;
2021-06-10 13:19:27 -07:00
/*
|--------------------------------------------------------------------------
| Asset Routes
|--------------------------------------------------------------------------
|
| Register all the asset routes.
|
*/
Route::group(
['prefix' => 'hardware',
'middleware' => ['auth'], ],
function () {
Route::get('bulkaudit', [
'as' => 'assets.bulkaudit',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'quickScan'],
]);
// Asset Maintenances
2021-06-10 13:17:14 -07:00
Route::resource('maintenances', AssetMaintenancesController::class, [
'parameters' => ['maintenance' => 'maintenance_id', 'asset' => 'asset_id'],
]);
2021-06-10 13:17:14 -07:00
Route::get('requested', ['as' => 'assets.requested', 'uses' => [Assets\AssetsController::class, 'getRequestedIndex']]);
2017-11-02 03:11:09 -07:00
Route::get('scan', [
'as' => 'asset.scan',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'scan'],
]);
Route::get('audit/due', [
'as' => 'assets.audit.due',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'dueForAudit'],
]);
Route::get('audit/overdue', [
'as' => 'assets.audit.overdue',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'overdueForAudit'],
]);
Merge branch 'develop' into v5-master-develop-integration # Conflicts: # .env.example # .travis.yml # Dockerfile # README.md # app/Console/Commands/LdapSync.php # app/Console/Kernel.php # app/Http/Controllers/AccessoriesController.php # app/Http/Controllers/Api/AccessoriesController.php # app/Http/Controllers/Api/AssetsController.php # app/Http/Controllers/Api/LocationsController.php # app/Http/Controllers/Api/SettingsController.php # app/Http/Controllers/Api/UsersController.php # app/Http/Controllers/AssetModelsController.php # app/Http/Controllers/Assets/AssetFilesController.php # app/Http/Controllers/Assets/AssetsController.php # app/Http/Controllers/CategoriesController.php # app/Http/Controllers/CompaniesController.php # app/Http/Controllers/ComponentsController.php # app/Http/Controllers/ConsumablesController.php # app/Http/Controllers/DepartmentsController.php # app/Http/Controllers/LicensesController.php # app/Http/Controllers/LocationsController.php # app/Http/Controllers/ManufacturersController.php # app/Http/Controllers/ReportsController.php # app/Http/Controllers/SettingsController.php # app/Http/Controllers/SuppliersController.php # app/Http/Controllers/UsersController.php # app/Http/Middleware/EncryptCookies.php # app/Http/Requests/AssetRequest.php # app/Http/Transformers/AssetMaintenancesTransformer.php # app/Importer/AssetImporter.php # app/Models/AssetMaintenance.php # app/Models/Location.php # app/Models/User.php # composer.json # composer.lock # config/backup.php # config/database.php # config/version.php # public/mix-manifest.json # resources/lang/en-ID/general.php # resources/lang/vi/admin/settings/general.php # resources/views/accessories/edit.blade.php # resources/views/hardware/view.blade.php # resources/views/layouts/default.blade.php # tests/api/ApiCategoriesCest.php
2019-11-18 19:49:39 -08:00
Route::get('audit/due', [
'as' => 'assets.audit.due',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'dueForAudit'],
Merge branch 'develop' into v5-master-develop-integration # Conflicts: # .env.example # .travis.yml # Dockerfile # README.md # app/Console/Commands/LdapSync.php # app/Console/Kernel.php # app/Http/Controllers/AccessoriesController.php # app/Http/Controllers/Api/AccessoriesController.php # app/Http/Controllers/Api/AssetsController.php # app/Http/Controllers/Api/LocationsController.php # app/Http/Controllers/Api/SettingsController.php # app/Http/Controllers/Api/UsersController.php # app/Http/Controllers/AssetModelsController.php # app/Http/Controllers/Assets/AssetFilesController.php # app/Http/Controllers/Assets/AssetsController.php # app/Http/Controllers/CategoriesController.php # app/Http/Controllers/CompaniesController.php # app/Http/Controllers/ComponentsController.php # app/Http/Controllers/ConsumablesController.php # app/Http/Controllers/DepartmentsController.php # app/Http/Controllers/LicensesController.php # app/Http/Controllers/LocationsController.php # app/Http/Controllers/ManufacturersController.php # app/Http/Controllers/ReportsController.php # app/Http/Controllers/SettingsController.php # app/Http/Controllers/SuppliersController.php # app/Http/Controllers/UsersController.php # app/Http/Middleware/EncryptCookies.php # app/Http/Requests/AssetRequest.php # app/Http/Transformers/AssetMaintenancesTransformer.php # app/Importer/AssetImporter.php # app/Models/AssetMaintenance.php # app/Models/Location.php # app/Models/User.php # composer.json # composer.lock # config/backup.php # config/database.php # config/version.php # public/mix-manifest.json # resources/lang/en-ID/general.php # resources/lang/vi/admin/settings/general.php # resources/views/accessories/edit.blade.php # resources/views/hardware/view.blade.php # resources/views/layouts/default.blade.php # tests/api/ApiCategoriesCest.php
2019-11-18 19:49:39 -08:00
]);
Route::get('audit/overdue', [
'as' => 'assets.audit.overdue',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'overdueForAudit'],
]);
Route::get('audit/due', [
'as' => 'assets.audit.due',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'dueForAudit'],
]);
Route::get('audit/overdue', [
'as' => 'assets.audit.overdue',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'overdueForAudit'],
]);
Route::get('audit/{id}', [
'as' => 'asset.audit.create',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'audit'],
]);
Route::post('audit/{id}', [
'as' => 'asset.audit.store',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'auditStore'],
]);
Route::get('history', [
'as' => 'asset.import-history',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'getImportHistory'],
]);
Route::post('history', [
'as' => 'asset.process-import-history',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'postImportHistory'],
]);
Route::get('bytag/{any?}',
[
'as' => 'findbytag/hardware',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'getAssetByTag'],
]
)->where('any', '.*');
Route::get('byserial/{any?}',
[
'as' => 'findbyserial/hardware',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'getAssetBySerial'],
]
)->where('any', '.*');
Route::get('{assetId}/clone', [
'as' => 'clone/hardware',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'getClone'],
]);
Route::get('{assetId}/label', [
'as' => 'label/hardware',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'getLabel'],
]);
2021-06-10 13:17:14 -07:00
Route::post('{assetId}/clone', [Assets\AssetsController::class, 'postCreate']);
Route::get('{assetId}/checkout', [
'as' => 'checkout/hardware',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetCheckoutController::class, 'create'],
]);
Route::post('{assetId}/checkout', [
'as' => 'checkout/hardware',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetCheckoutController::class, 'store'],
]);
Route::get('{assetId}/checkin/{backto?}', [
'as' => 'checkin/hardware',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetCheckinController::class, 'create'],
]);
Route::post('{assetId}/checkin/{backto?}', [
'as' => 'checkin/hardware',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetCheckinController::class, 'store'],
]);
Route::get('{assetId}/view', [
'as' => 'hardware.view',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'show'],
]);
2021-06-10 13:17:14 -07:00
Route::get('{assetId}/qr_code', ['as' => 'qr_code/hardware', 'uses' => [Assets\AssetsController::class, 'getQrCode']]);
Route::get('{assetId}/barcode', ['as' => 'barcode/hardware', 'uses' => [Assets\AssetsController::class, 'getBarCode']]);
Route::get('{assetId}/restore', [
'as' => 'restore/hardware',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetsController::class, 'getRestore'],
]);
Route::post('{assetId}/upload', [
'as' => 'upload/asset',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetFilesController::class, 'store'],
]);
Route::get('{assetId}/showfile/{fileId}/{download?}', [
'as' => 'show/assetfile',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetFilesController::class, 'show'],
]);
Route::delete('{assetId}/showfile/{fileId}/delete', [
'as' => 'delete/assetfile',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\AssetFilesController::class, 'destroy'],
]);
Route::post(
'bulkedit',
[
'as' => 'hardware/bulkedit',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\BulkAssetsController::class, 'edit'],
]
);
Route::post(
'bulkdelete',
[
'as' => 'hardware/bulkdelete',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\BulkAssetsController::class, 'destroy'],
]
);
Route::post(
'bulksave',
[
'as' => 'hardware/bulksave',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\BulkAssetsController::class, 'update'],
]
);
// Bulk checkout / checkin
Route::get('bulkcheckout', [
'as' => 'hardware/bulkcheckout',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\BulkAssetsController::class, 'showCheckout'],
]);
Route::post('bulkcheckout', [
'as' => 'hardware/bulkcheckout',
2021-06-10 13:17:14 -07:00
'uses' => [Assets\BulkAssetsController::class, 'storeCheckout'],
]);
});
2021-06-10 13:17:14 -07:00
Route::resource('hardware', Assets\AssetsController::class, [
'middleware' => ['auth'],
'parameters' => ['asset' => 'asset_id'],
]);