2016-12-15 04:12:18 -08:00
|
|
|
<?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
|
|
|
|
2016-12-15 04:12:18 -08:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Asset Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Register all the asset routes.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(
|
|
|
|
['prefix' => 'hardware',
|
2021-06-10 13:15:52 -07:00
|
|
|
'middleware' => ['auth'], ],
|
2016-12-15 04:12:18 -08:00
|
|
|
function () {
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('bulkaudit',
|
|
|
|
[Assets\AssetsController::class, 'quickScan']
|
|
|
|
)->name('assets.bulkaudit');
|
2017-08-29 16:00:22 -07:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
// Asset Maintenances
|
2021-06-10 13:17:14 -07:00
|
|
|
Route::resource('maintenances', AssetMaintenancesController::class, [
|
2021-06-10 13:15:52 -07:00
|
|
|
'parameters' => ['maintenance' => 'maintenance_id', 'asset' => 'asset_id'],
|
2016-12-15 04:12:18 -08:00
|
|
|
]);
|
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('requested', [Assets\AssetsController::class, 'getRequestedIndex'])->name('assets.requested');
|
2017-11-02 03:11:09 -07:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('scan',
|
|
|
|
[Assets\AssetsController::class, 'scan']
|
|
|
|
)->name('asset.scan');
|
2017-08-26 16:16:41 -07:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('audit/due',
|
|
|
|
[Assets\AssetsController::class, 'dueForAudit']
|
|
|
|
)->name('assets.audit.due');
|
2019-05-05 19:32:52 -07:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('audit/overdue',
|
|
|
|
[Assets\AssetsController::class, 'overdueForAudit']
|
|
|
|
)->name('assets.audit.overdue');
|
2019-05-05 16:13:37 -07:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('audit/due',
|
|
|
|
[Assets\AssetsController::class, 'dueForAudit']
|
|
|
|
)->name('assets.audit.due');
|
2019-11-18 19:49:39 -08:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('audit/overdue',
|
|
|
|
[Assets\AssetsController::class, 'overdueForAudit']
|
|
|
|
)->name('assets.audit.overdue');
|
2017-08-26 16:16:41 -07:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('audit/due',
|
|
|
|
[Assets\AssetsController::class, 'dueForAudit']
|
|
|
|
)->name('assets.audit.due');
|
2019-05-05 19:32:52 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('audit/overdue',
|
|
|
|
[Assets\AssetsController::class, 'overdueForAudit']
|
|
|
|
)->name('assets.audit.overdue');
|
2019-05-05 19:32:52 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('audit/{id}',
|
|
|
|
[Assets\AssetsController::class, 'audit']
|
|
|
|
)->name('asset.audit.create');
|
2017-08-25 10:04:19 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::post('audit/{id}',
|
|
|
|
[Assets\AssetsController::class, 'auditStore']
|
|
|
|
)->name('asset.audit.store');
|
2017-08-25 10:04:19 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('history',
|
|
|
|
[Assets\AssetsController::class, 'getImportHistory']
|
|
|
|
)->name('asset.import-history');
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::post('history',
|
|
|
|
[Assets\AssetsController::class, 'postImportHistory']
|
|
|
|
)->name('asset.process-import-history');
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2020-03-06 14:55:20 -08:00
|
|
|
Route::get('bytag/{any?}',
|
2021-06-22 18:58:25 -07:00
|
|
|
[Assets\AssetsController::class, 'getAssetByTag']
|
|
|
|
)->where('any', '.*')->name('findbytag/hardware');
|
2020-03-06 14:55:20 -08:00
|
|
|
|
|
|
|
Route::get('byserial/{any?}',
|
2021-06-22 18:58:25 -07:00
|
|
|
[Assets\AssetsController::class, 'getAssetBySerial']
|
|
|
|
)->where('any', '.*')->name('findbyserial/hardware');
|
2016-12-15 16:42:28 -08:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('{assetId}/clone',
|
|
|
|
[Assets\AssetsController::class, 'getClone']
|
|
|
|
)->name('clone/hardware');
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('{assetId}/label',
|
|
|
|
[Assets\AssetsController::class, 'getLabel']
|
|
|
|
)->name('label/hardware');
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::post('{assetId}/clone', [Assets\AssetsController::class, 'postCreate']);
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('{assetId}/checkout',
|
|
|
|
[Assets\AssetCheckoutController::class, 'create']
|
|
|
|
)->name('checkout/hardware');
|
|
|
|
Route::post('{assetId}/checkout',
|
|
|
|
[Assets\AssetCheckoutController::class, 'store']
|
|
|
|
)->name('checkout/hardware');
|
|
|
|
Route::get('{assetId}/checkin/{backto?}',
|
|
|
|
[Assets\AssetCheckinController::class, 'create']
|
|
|
|
)->name('checkin/hardware');
|
|
|
|
|
|
|
|
Route::post('{assetId}/checkin/{backto?}',
|
|
|
|
[Assets\AssetCheckinController::class, 'store']
|
|
|
|
)->name('checkin/hardware');
|
|
|
|
Route::get('{assetId}/view',
|
|
|
|
[Assets\AssetsController::class, 'show']
|
|
|
|
)->name('hardware.view');
|
|
|
|
Route::get('{assetId}/qr_code', [Assets\AssetsController::class, 'getQrCode'])->name('qr_code/hardware');
|
|
|
|
Route::get('{assetId}/barcode', [Assets\AssetsController::class, 'getBarCode'])->name('barcode/hardware');
|
|
|
|
Route::get('{assetId}/restore',
|
|
|
|
[Assets\AssetsController::class, 'getRestore']
|
|
|
|
)->name('restore/hardware');
|
|
|
|
Route::post('{assetId}/upload',
|
|
|
|
[Assets\AssetFilesController::class, 'store']
|
|
|
|
)->name('upload/asset');
|
|
|
|
|
|
|
|
Route::get('{assetId}/showfile/{fileId}/{download?}',
|
|
|
|
[Assets\AssetFilesController::class, 'show']
|
|
|
|
)->name('show/assetfile');
|
|
|
|
|
|
|
|
Route::delete('{assetId}/showfile/{fileId}/delete',
|
|
|
|
[Assets\AssetFilesController::class, 'destroy']
|
|
|
|
)->name('delete/assetfile');
|
2017-09-05 17:54:58 -07:00
|
|
|
|
2016-12-15 04:12:18 -08:00
|
|
|
Route::post(
|
|
|
|
'bulkedit',
|
2021-06-22 18:58:25 -07:00
|
|
|
[Assets\BulkAssetsController::class, 'edit']
|
|
|
|
)->name('hardware/bulkedit');
|
2016-12-15 04:12:18 -08:00
|
|
|
Route::post(
|
|
|
|
'bulkdelete',
|
2021-06-22 18:58:25 -07:00
|
|
|
[Assets\BulkAssetsController::class, 'destroy']
|
|
|
|
)->name('hardware/bulkdelete');
|
2016-12-15 04:12:18 -08:00
|
|
|
Route::post(
|
|
|
|
'bulksave',
|
2021-06-22 18:58:25 -07:00
|
|
|
[Assets\BulkAssetsController::class, 'update']
|
|
|
|
)->name('hardware/bulksave');
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
// Bulk checkout / checkin
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('bulkcheckout',
|
|
|
|
[Assets\BulkAssetsController::class, 'showCheckout']
|
|
|
|
)->name('hardware/bulkcheckout');
|
|
|
|
Route::post('bulkcheckout',
|
|
|
|
[Assets\BulkAssetsController::class, 'storeCheckout']
|
|
|
|
)->name('hardware/bulkcheckout');
|
2021-06-10 13:15:52 -07:00
|
|
|
});
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2021-06-10 13:17:14 -07:00
|
|
|
Route::resource('hardware', Assets\AssetsController::class, [
|
2017-03-11 05:16:56 -08:00
|
|
|
'middleware' => ['auth'],
|
2021-06-10 13:15:52 -07:00
|
|
|
'parameters' => ['asset' => 'asset_id'],
|
2016-12-15 04:12:18 -08:00
|
|
|
]);
|