2016-12-15 04:12:18 -08:00
|
|
|
<?php
|
2021-06-10 13:17:14 -07:00
|
|
|
|
|
|
|
use App\Http\Controllers\AssetMaintenancesController;
|
2021-09-23 21:46:17 -07:00
|
|
|
use App\Http\Controllers\Assets\AssetsController;
|
|
|
|
use App\Http\Controllers\Assets\BulkAssetsController;
|
|
|
|
use App\Http\Controllers\Assets\AssetCheckoutController;
|
|
|
|
use App\Http\Controllers\Assets\AssetCheckinController;
|
|
|
|
use App\Http\Controllers\Assets\AssetFilesController;
|
2021-06-10 13:17:14 -07:00
|
|
|
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(
|
2021-09-23 21:46:17 -07:00
|
|
|
[
|
|
|
|
'prefix' => 'hardware',
|
|
|
|
'middleware' => ['auth'],
|
|
|
|
],
|
|
|
|
|
2016-12-15 04:12:18 -08:00
|
|
|
function () {
|
2021-09-23 21:46:17 -07:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('bulkaudit',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'quickScan']
|
2021-06-22 16:58:23 -07:00
|
|
|
)->name('assets.bulkaudit');
|
2017-08-29 16:00:22 -07:00
|
|
|
|
2021-12-20 20:27:36 -08:00
|
|
|
Route::get('quickscancheckin',
|
2021-12-19 13:53:31 -08:00
|
|
|
[AssetsController::class, 'quickScanCheckin']
|
2021-12-20 20:27:36 -08:00
|
|
|
)->name('hardware/quickscancheckin');
|
2021-12-19 13:53:31 -08:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
// Asset Maintenances
|
2021-09-23 21:46:17 -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-09-23 21:46:17 -07:00
|
|
|
Route::get('requested', [
|
|
|
|
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',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'scan']
|
2021-06-22 16:58:23 -07:00
|
|
|
)->name('asset.scan');
|
2017-08-26 16:16:41 -07:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('audit/due',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'dueForAudit']
|
2021-06-22 16:58:23 -07:00
|
|
|
)->name('assets.audit.due');
|
2019-05-05 19:32:52 -07:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('audit/overdue',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'overdueForAudit']
|
2021-06-22 16:58:23 -07:00
|
|
|
)->name('assets.audit.overdue');
|
2019-05-05 16:13:37 -07:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('audit/due',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'dueForAudit']
|
2021-06-22 16:58:23 -07:00
|
|
|
)->name('assets.audit.due');
|
2019-11-18 19:49:39 -08:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('audit/overdue',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'overdueForAudit']
|
2021-06-22 16:58:23 -07:00
|
|
|
)->name('assets.audit.overdue');
|
2017-08-26 16:16:41 -07:00
|
|
|
|
2021-06-22 16:58:23 -07:00
|
|
|
Route::get('audit/due',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'dueForAudit']
|
2021-06-22 16:58:23 -07:00
|
|
|
)->name('assets.audit.due');
|
2019-05-05 19:32:52 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('audit/overdue',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'overdueForAudit']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('assets.audit.overdue');
|
2019-05-05 19:32:52 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('audit/{id}',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'audit']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('asset.audit.create');
|
2017-08-25 10:04:19 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::post('audit/{id}',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'auditStore']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('asset.audit.store');
|
2017-08-25 10:04:19 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('history',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'getImportHistory']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('asset.import-history');
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::post('history',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'postImportHistory']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->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-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'getAssetByTag']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->where('any', '.*')->name('findbytag/hardware');
|
2020-03-06 14:55:20 -08:00
|
|
|
|
|
|
|
Route::get('byserial/{any?}',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'getAssetBySerial']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->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',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'getClone']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('clone/hardware');
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('{assetId}/label',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'getLabel']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('label/hardware');
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2021-09-23 21:46:17 -07:00
|
|
|
Route::post('{assetId}/clone',
|
|
|
|
[AssetsController::class, 'postCreate']
|
|
|
|
);
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('{assetId}/checkout',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetCheckoutController::class, 'create']
|
2022-08-01 15:59:54 -07:00
|
|
|
)->name('hardware.checkout.create');
|
2021-09-23 21:46:17 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::post('{assetId}/checkout',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetCheckoutController::class, 'store']
|
2022-08-01 15:59:54 -07:00
|
|
|
)->name('hardware.checkout.store');
|
2021-09-23 21:46:17 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::get('{assetId}/checkin/{backto?}',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetCheckinController::class, 'create']
|
2022-08-01 15:59:54 -07:00
|
|
|
)->name('hardware.checkin.create');
|
2021-06-22 18:58:25 -07:00
|
|
|
|
|
|
|
Route::post('{assetId}/checkin/{backto?}',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetCheckinController::class, 'store']
|
2022-08-01 15:59:54 -07:00
|
|
|
)->name('hardware.checkin.store');
|
2021-09-23 21:46:17 -07:00
|
|
|
|
2023-11-08 06:44:09 -08:00
|
|
|
// Redirect old legacy /asset_id/view urls to the resource route version
|
2023-11-08 06:40:56 -08:00
|
|
|
Route::get('{assetId}/view', function ($assetId) {
|
|
|
|
return redirect()->route('hardware.show', ['hardware' => $assetId]);
|
|
|
|
});
|
2021-09-23 21:46:17 -07:00
|
|
|
|
|
|
|
Route::get('{assetId}/qr_code',
|
|
|
|
[AssetsController::class, 'getQrCode']
|
|
|
|
)->name('qr_code/hardware');
|
|
|
|
|
|
|
|
Route::get('{assetId}/barcode',
|
|
|
|
[AssetsController::class, 'getBarCode']
|
|
|
|
)->name('barcode/hardware');
|
|
|
|
|
2022-07-02 09:07:26 -07:00
|
|
|
Route::post('{assetId}/restore',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetsController::class, 'getRestore']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('restore/hardware');
|
2021-09-23 21:46:17 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::post('{assetId}/upload',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetFilesController::class, 'store']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('upload/asset');
|
|
|
|
|
|
|
|
Route::get('{assetId}/showfile/{fileId}/{download?}',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetFilesController::class, 'show']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('show/assetfile');
|
|
|
|
|
|
|
|
Route::delete('{assetId}/showfile/{fileId}/delete',
|
2021-09-23 21:46:17 -07:00
|
|
|
[AssetFilesController::class, 'destroy']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('delete/assetfile');
|
2017-09-05 17:54:58 -07:00
|
|
|
|
2016-12-15 04:12:18 -08:00
|
|
|
Route::post(
|
|
|
|
'bulkedit',
|
2021-09-23 21:46:17 -07:00
|
|
|
[BulkAssetsController::class, 'edit']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('hardware/bulkedit');
|
2021-09-23 21:46:17 -07:00
|
|
|
|
2016-12-15 04:12:18 -08:00
|
|
|
Route::post(
|
|
|
|
'bulkdelete',
|
2021-09-23 21:46:17 -07:00
|
|
|
[BulkAssetsController::class, 'destroy']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->name('hardware/bulkdelete');
|
2021-09-23 21:46:17 -07:00
|
|
|
|
2023-03-29 16:24:56 -07:00
|
|
|
Route::post(
|
|
|
|
'bulkrestore',
|
|
|
|
[BulkAssetsController::class, 'restore']
|
|
|
|
)->name('hardware/bulkrestore');
|
|
|
|
|
2016-12-15 04:12:18 -08:00
|
|
|
Route::post(
|
|
|
|
'bulksave',
|
2021-09-23 21:46:17 -07:00
|
|
|
[BulkAssetsController::class, 'update']
|
2021-06-22 18:58:25 -07:00
|
|
|
)->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',
|
2021-09-23 21:46:17 -07:00
|
|
|
[BulkAssetsController::class, 'showCheckout']
|
2022-08-01 15:59:54 -07:00
|
|
|
)->name('hardware.bulkcheckout.show');
|
2021-09-23 21:46:17 -07:00
|
|
|
|
2021-06-22 18:58:25 -07:00
|
|
|
Route::post('bulkcheckout',
|
2021-09-23 21:46:17 -07:00
|
|
|
[BulkAssetsController::class, 'storeCheckout']
|
2022-08-01 15:59:54 -07:00
|
|
|
)->name('hardware.bulkcheckout.store');
|
2023-11-08 06:40:56 -08:00
|
|
|
|
2021-06-10 13:15:52 -07:00
|
|
|
});
|
2016-12-15 04:12:18 -08:00
|
|
|
|
2021-09-23 21:46:17 -07:00
|
|
|
Route::resource('hardware',
|
|
|
|
AssetsController::class,
|
|
|
|
[
|
|
|
|
'middleware' => ['auth'],
|
2023-11-13 08:39:35 -08:00
|
|
|
'parameters' => ['asset' => 'asset_id',
|
|
|
|
'names' => [
|
|
|
|
'show' => 'view',
|
|
|
|
],
|
|
|
|
],
|
2022-11-01 05:01:18 -07:00
|
|
|
]);
|
|
|
|
|
|
|
|
Route::get('ht/{any?}',
|
|
|
|
[AssetsController::class, 'getAssetByTag']
|
2023-07-30 16:57:29 -07:00
|
|
|
)->where('any', '.*')->name('ht/assetTag');
|