More route fixes

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2021-09-23 21:46:17 -07:00
parent d82490f4a6
commit 1ecd11dd2e
2 changed files with 84 additions and 52 deletions

View file

@ -41,10 +41,10 @@ Route::group(['prefix' => 'v1', 'middleware' => 'api'], function () {
)->name('api.assets.requested');
Route::get('requestable/hardware',
[
Api\AssetsController::class,
'requestable'
]
[
Api\AssetsController::class,
'requestable'
]
)->name('api.assets.requestable');
@ -295,13 +295,15 @@ Route::group(['prefix' => 'v1', 'middleware' => 'api'], function () {
]
); // end depreciations API routes
Route::get(
'reports/depreciation',
[
'as' => 'api.depreciation-report.index',
'uses' => 'AssetsController@index'
]
);
Route::post('reports/depreciation',
[
Api\AssetsController::class,
'index'
]
)->name('api.depreciation-report.index');
/**
* Fields API routes

View file

@ -1,7 +1,11 @@
<?php
use App\Http\Controllers\AssetMaintenancesController;
use App\Http\Controllers\Assets;
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;
use Illuminate\Support\Facades\Route;
/*
@ -13,138 +17,164 @@ use Illuminate\Support\Facades\Route;
|
*/
Route::group(
['prefix' => 'hardware',
'middleware' => ['auth'], ],
[
'prefix' => 'hardware',
'middleware' => ['auth'],
],
function () {
Route::get('bulkaudit',
[Assets\AssetsController::class, 'quickScan']
[AssetsController::class, 'quickScan']
)->name('assets.bulkaudit');
// Asset Maintenances
Route::resource('maintenances', AssetMaintenancesController::class, [
Route::resource('maintenances',
AssetMaintenancesController::class, [
'parameters' => ['maintenance' => 'maintenance_id', 'asset' => 'asset_id'],
]);
Route::get('requested', [Assets\AssetsController::class, 'getRequestedIndex'])->name('assets.requested');
Route::get('requested', [
AssetsController::class, 'getRequestedIndex']
)->name('assets.requested');
Route::get('scan',
[Assets\AssetsController::class, 'scan']
[AssetsController::class, 'scan']
)->name('asset.scan');
Route::get('audit/due',
[Assets\AssetsController::class, 'dueForAudit']
[AssetsController::class, 'dueForAudit']
)->name('assets.audit.due');
Route::get('audit/overdue',
[Assets\AssetsController::class, 'overdueForAudit']
[AssetsController::class, 'overdueForAudit']
)->name('assets.audit.overdue');
Route::get('audit/due',
[Assets\AssetsController::class, 'dueForAudit']
[AssetsController::class, 'dueForAudit']
)->name('assets.audit.due');
Route::get('audit/overdue',
[Assets\AssetsController::class, 'overdueForAudit']
[AssetsController::class, 'overdueForAudit']
)->name('assets.audit.overdue');
Route::get('audit/due',
[Assets\AssetsController::class, 'dueForAudit']
[AssetsController::class, 'dueForAudit']
)->name('assets.audit.due');
Route::get('audit/overdue',
[Assets\AssetsController::class, 'overdueForAudit']
[AssetsController::class, 'overdueForAudit']
)->name('assets.audit.overdue');
Route::get('audit/{id}',
[Assets\AssetsController::class, 'audit']
[AssetsController::class, 'audit']
)->name('asset.audit.create');
Route::post('audit/{id}',
[Assets\AssetsController::class, 'auditStore']
[AssetsController::class, 'auditStore']
)->name('asset.audit.store');
Route::get('history',
[Assets\AssetsController::class, 'getImportHistory']
[AssetsController::class, 'getImportHistory']
)->name('asset.import-history');
Route::post('history',
[Assets\AssetsController::class, 'postImportHistory']
[AssetsController::class, 'postImportHistory']
)->name('asset.process-import-history');
Route::get('bytag/{any?}',
[Assets\AssetsController::class, 'getAssetByTag']
[AssetsController::class, 'getAssetByTag']
)->where('any', '.*')->name('findbytag/hardware');
Route::get('byserial/{any?}',
[Assets\AssetsController::class, 'getAssetBySerial']
[AssetsController::class, 'getAssetBySerial']
)->where('any', '.*')->name('findbyserial/hardware');
Route::get('{assetId}/clone',
[Assets\AssetsController::class, 'getClone']
[AssetsController::class, 'getClone']
)->name('clone/hardware');
Route::get('{assetId}/label',
[Assets\AssetsController::class, 'getLabel']
[AssetsController::class, 'getLabel']
)->name('label/hardware');
Route::post('{assetId}/clone', [Assets\AssetsController::class, 'postCreate']);
Route::post('{assetId}/clone',
[AssetsController::class, 'postCreate']
);
Route::get('{assetId}/checkout',
[Assets\AssetCheckoutController::class, 'create']
[AssetCheckoutController::class, 'create']
)->name('checkout/hardware');
Route::post('{assetId}/checkout',
[Assets\AssetCheckoutController::class, 'store']
[AssetCheckoutController::class, 'store']
)->name('checkout/hardware');
Route::get('{assetId}/checkin/{backto?}',
[Assets\AssetCheckinController::class, 'create']
[AssetCheckinController::class, 'create']
)->name('checkin/hardware');
Route::post('{assetId}/checkin/{backto?}',
[Assets\AssetCheckinController::class, 'store']
[AssetCheckinController::class, 'store']
)->name('checkin/hardware');
Route::get('{assetId}/view',
[Assets\AssetsController::class, 'show']
[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}/qr_code',
[AssetsController::class, 'getQrCode']
)->name('qr_code/hardware');
Route::get('{assetId}/barcode',
[AssetsController::class, 'getBarCode']
)->name('barcode/hardware');
Route::get('{assetId}/restore',
[Assets\AssetsController::class, 'getRestore']
[AssetsController::class, 'getRestore']
)->name('restore/hardware');
Route::post('{assetId}/upload',
[Assets\AssetFilesController::class, 'store']
[AssetFilesController::class, 'store']
)->name('upload/asset');
Route::get('{assetId}/showfile/{fileId}/{download?}',
[Assets\AssetFilesController::class, 'show']
[AssetFilesController::class, 'show']
)->name('show/assetfile');
Route::delete('{assetId}/showfile/{fileId}/delete',
[Assets\AssetFilesController::class, 'destroy']
[AssetFilesController::class, 'destroy']
)->name('delete/assetfile');
Route::post(
'bulkedit',
[Assets\BulkAssetsController::class, 'edit']
[BulkAssetsController::class, 'edit']
)->name('hardware/bulkedit');
Route::post(
'bulkdelete',
[Assets\BulkAssetsController::class, 'destroy']
[BulkAssetsController::class, 'destroy']
)->name('hardware/bulkdelete');
Route::post(
'bulksave',
[Assets\BulkAssetsController::class, 'update']
[BulkAssetsController::class, 'update']
)->name('hardware/bulksave');
// Bulk checkout / checkin
Route::get('bulkcheckout',
[Assets\BulkAssetsController::class, 'showCheckout']
[BulkAssetsController::class, 'showCheckout']
)->name('hardware/bulkcheckout');
Route::post('bulkcheckout',
[Assets\BulkAssetsController::class, 'storeCheckout']
[BulkAssetsController::class, 'storeCheckout']
)->name('hardware/bulkcheckout');
});
Route::resource('hardware', Assets\AssetsController::class, [
'middleware' => ['auth'],
'parameters' => ['asset' => 'asset_id'],
Route::resource('hardware',
AssetsController::class,
[
'middleware' => ['auth'],
'parameters' => ['asset' => 'asset_id'
],
]);