2016-12-14 04:32:10 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| API Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here is where you can register API routes for your application. These
|
|
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
|
|
| is assigned the "api" middleware group. Enjoy building your API!
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2016-12-14 10:54:05 -08:00
|
|
|
|
2019-05-08 06:23:54 -07:00
|
|
|
Route::group(['prefix' => 'v1','namespace' => 'Api', 'middleware' => 'api'], function () {
|
2017-01-12 23:41:08 -08:00
|
|
|
|
2018-04-04 17:33:02 -07:00
|
|
|
Route::group(['prefix' => 'account'], function () {
|
|
|
|
Route::get('requestable/hardware',
|
|
|
|
[
|
|
|
|
'as' => 'api.assets.requestable',
|
|
|
|
'uses' => 'AssetsController@requestable'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
Route::get('requests',
|
|
|
|
[
|
|
|
|
'as' => 'api.assets.requested',
|
|
|
|
'uses' => 'ProfileController@requestedAssets'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
2017-01-25 21:29:23 -08:00
|
|
|
|
2018-04-04 17:33:02 -07:00
|
|
|
/*--- Accessories API ---*/
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::resource('accessories', 'AccessoriesController',
|
2017-01-25 21:29:23 -08:00
|
|
|
['names' =>
|
|
|
|
[
|
2017-02-23 16:32:35 -08:00
|
|
|
'index' => 'api.accessories.index',
|
|
|
|
'show' => 'api.accessories.show',
|
|
|
|
'update' => 'api.accessories.update',
|
|
|
|
'store' => 'api.accessories.store',
|
|
|
|
'destroy' => 'api.accessories.destroy'
|
2017-01-25 21:29:23 -08:00
|
|
|
],
|
2017-02-23 16:32:35 -08:00
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['accessory' => 'accessory_id']
|
2017-01-25 21:29:23 -08:00
|
|
|
]
|
2017-02-23 16:32:35 -08:00
|
|
|
); // Accessories resource
|
2017-01-24 18:58:07 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::group(['prefix' => 'accessories'], function () {
|
2017-01-24 18:58:07 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::get('{accessory}/checkedout',
|
|
|
|
[
|
|
|
|
'as' => 'api.accessories.checkedout',
|
|
|
|
'uses' => 'AccessoriesController@checkedout'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}); // Accessories group
|
2017-01-26 21:02:59 -08:00
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Categories API ---*/
|
2017-01-13 04:50:20 -08:00
|
|
|
|
2017-10-26 22:09:08 -07:00
|
|
|
Route::group(['prefix' => 'categories'], function () {
|
|
|
|
|
2017-10-28 11:17:52 -07:00
|
|
|
Route::get('{item_type}/selectlist',
|
2017-10-26 22:09:08 -07:00
|
|
|
[
|
|
|
|
'as' => 'api.categories.selectlist',
|
|
|
|
'uses' => 'CategoriesController@selectlist'
|
|
|
|
]
|
|
|
|
);
|
2017-10-28 11:17:52 -07:00
|
|
|
|
2017-10-26 22:09:08 -07:00
|
|
|
}); // Categories group
|
|
|
|
|
|
|
|
|
2017-01-13 09:01:10 -08:00
|
|
|
Route::resource('categories', 'CategoriesController',
|
2017-02-23 16:32:35 -08:00
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.categories.index',
|
|
|
|
'show' => 'api.categories.show',
|
|
|
|
'store' => 'api.categories.store',
|
|
|
|
'update' => 'api.categories.update',
|
|
|
|
'destroy' => 'api.categories.destroy'
|
|
|
|
],
|
2017-01-13 09:01:10 -08:00
|
|
|
'except' => ['edit', 'create'],
|
|
|
|
'parameters' => ['category' => 'category_id']
|
|
|
|
]
|
2017-02-23 16:32:35 -08:00
|
|
|
); // Categories resource
|
|
|
|
|
2017-01-13 04:50:20 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Companies API ---*/
|
2017-01-13 04:50:20 -08:00
|
|
|
|
2017-10-26 16:37:41 -07:00
|
|
|
Route::get( 'companies/selectlist', [
|
|
|
|
'as' => 'companies.selectlist',
|
|
|
|
'uses' => 'CompaniesController@selectlist'
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
2017-01-12 23:41:08 -08:00
|
|
|
Route::resource('companies', 'CompaniesController',
|
2017-02-23 16:32:35 -08:00
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.companies.index',
|
|
|
|
'show' => 'api.companies.show',
|
|
|
|
'store' => 'api.companies.store',
|
|
|
|
'update' => 'api.companies.update',
|
|
|
|
'destroy' => 'api.companies.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
2017-01-12 23:41:08 -08:00
|
|
|
'parameters' => ['component' => 'component_id']
|
|
|
|
]
|
2017-02-23 16:32:35 -08:00
|
|
|
); // Companies resource
|
2017-01-12 19:41:01 -08:00
|
|
|
|
|
|
|
|
2017-05-22 21:31:47 -07:00
|
|
|
/*--- Departments API ---*/
|
|
|
|
|
2017-10-28 09:21:39 -07:00
|
|
|
/*--- Suppliers API ---*/
|
|
|
|
Route::group(['prefix' => 'departments'], function () {
|
|
|
|
|
|
|
|
|
|
|
|
Route::get('selectlist',
|
|
|
|
[
|
|
|
|
'as' => 'api.departments.selectlist',
|
|
|
|
'uses' => 'DepartmentsController@selectlist'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}); // Departments group
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-22 21:31:47 -07:00
|
|
|
Route::resource('departments', 'DepartmentsController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.departments.index',
|
|
|
|
'show' => 'api.departments.show',
|
|
|
|
'store' => 'api.departments.store',
|
|
|
|
'update' => 'api.departments.update',
|
|
|
|
'destroy' => 'api.departments.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['department' => 'department_id']
|
|
|
|
]
|
|
|
|
); // Departments resource
|
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Components API ---*/
|
2017-01-12 19:41:01 -08:00
|
|
|
|
2017-01-12 23:41:08 -08:00
|
|
|
Route::resource('components', 'ComponentsController',
|
2017-02-23 16:32:35 -08:00
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.components.index',
|
|
|
|
'show' => 'api.components.show',
|
|
|
|
'store' => 'api.components.store',
|
|
|
|
'update' => 'api.components.update',
|
|
|
|
'destroy' => 'api.components.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['component' => 'component_id']
|
2017-01-12 19:41:01 -08:00
|
|
|
]
|
2017-02-23 16:32:35 -08:00
|
|
|
); // Components resource
|
2017-01-12 19:41:01 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::group(['prefix' => 'components'], function () {
|
2017-02-21 14:26:46 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::get('{component}/assets',
|
2017-01-12 19:41:01 -08:00
|
|
|
[
|
2017-02-23 16:32:35 -08:00
|
|
|
'as' =>'api.components.assets',
|
|
|
|
'uses' => 'ComponentsController@getAssets',
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}); // Components group
|
2017-01-12 19:41:01 -08:00
|
|
|
|
2017-02-01 17:59:03 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Consumables API ---*/
|
|
|
|
|
|
|
|
Route::resource('consumables', 'ConsumablesController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.consumables.index',
|
|
|
|
'show' => 'api.consumables.show',
|
|
|
|
'store' => 'api.consumables.store',
|
|
|
|
'update' => 'api.consumables.update',
|
|
|
|
'destroy' => 'api.consumables.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['consumable' => 'consumable_id']
|
2017-02-01 18:50:28 -08:00
|
|
|
]
|
2017-02-23 16:32:35 -08:00
|
|
|
); // Consumables resource
|
2017-09-05 17:54:58 -07:00
|
|
|
Route::get('consumables/view/{id}/users',
|
|
|
|
[
|
|
|
|
'as' => 'api.consumables.showUsers',
|
|
|
|
'uses' => 'ConsumablesController@getDataView'
|
|
|
|
]
|
|
|
|
);
|
2017-02-01 18:50:28 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Depreciations API ---*/
|
2017-02-01 18:50:28 -08:00
|
|
|
|
2017-02-01 17:59:03 -08:00
|
|
|
Route::resource('depreciations', 'DepreciationsController',
|
2017-02-23 16:32:35 -08:00
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.depreciations.index',
|
|
|
|
'show' => 'api.depreciations.show',
|
|
|
|
'store' => 'api.depreciations.store',
|
|
|
|
'update' => 'api.depreciations.update',
|
|
|
|
'destroy' => 'api.depreciations.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['depreciation' => 'depreciation_id']
|
2017-02-01 17:59:03 -08:00
|
|
|
]
|
2017-02-23 16:32:35 -08:00
|
|
|
); // Depreciations resource
|
2017-02-01 17:59:03 -08:00
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Fields API ---*/
|
2017-01-12 19:41:01 -08:00
|
|
|
|
2018-01-17 05:31:57 -08:00
|
|
|
Route::resource('fields', 'CustomFieldsController', [
|
|
|
|
'names' => [
|
|
|
|
'index' => 'api.customfields.index',
|
|
|
|
'show' => 'api.customfields.show',
|
|
|
|
'store' => 'api.customfields.store',
|
|
|
|
'update' => 'api.customfields.update',
|
|
|
|
'destroy' => 'api.customfields.destroy'
|
|
|
|
],
|
|
|
|
'except' => [ 'create', 'edit' ],
|
|
|
|
'parameters' => [ 'field' => 'field_id' ]
|
|
|
|
]);
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::group(['prefix' => 'fields'], function () {
|
|
|
|
Route::post('fieldsets/{id}/order',
|
2017-01-12 19:41:01 -08:00
|
|
|
[
|
2017-02-23 16:32:35 -08:00
|
|
|
'as' => 'api.customfields.order',
|
|
|
|
'uses' => 'CustomFieldsController@postReorder'
|
2017-09-18 12:29:08 -07:00
|
|
|
]
|
|
|
|
);
|
2018-01-22 13:14:04 -08:00
|
|
|
Route::post('{field}/associate',
|
|
|
|
[
|
|
|
|
'as' => 'api.customfields.associate',
|
|
|
|
'uses' => 'CustomFieldsController@associate'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
Route::post('{field}/disassociate',
|
|
|
|
[
|
|
|
|
'as' => 'api.customfields.disassociate',
|
|
|
|
'uses' => 'CustomFieldsController@disassociate'
|
|
|
|
]
|
|
|
|
);
|
2017-02-23 16:32:35 -08:00
|
|
|
}); // Fields group
|
|
|
|
|
|
|
|
|
2017-07-12 17:51:22 -07:00
|
|
|
/*--- Fieldsets API ---*/
|
|
|
|
|
2018-01-22 13:14:04 -08:00
|
|
|
Route::group(['prefix' => 'fieldsets'], function () {
|
|
|
|
Route::get('{fieldset}/fields',
|
|
|
|
[
|
|
|
|
'as' => 'api.fieldsets.fields',
|
|
|
|
'uses' => 'CustomFieldsetsController@fields'
|
|
|
|
]
|
|
|
|
);
|
2018-04-23 21:16:55 -07:00
|
|
|
Route::get('/{fieldset}/fields/{model}',
|
|
|
|
[
|
|
|
|
'as' => 'api.fieldsets.fields-with-default-value',
|
|
|
|
'uses' => 'CustomFieldsetsController@fieldsWithDefaultValues'
|
|
|
|
]
|
|
|
|
);
|
2018-01-22 13:14:04 -08:00
|
|
|
});
|
|
|
|
|
2017-07-12 19:24:21 -07:00
|
|
|
Route::resource('fieldsets', 'CustomFieldsetsController',
|
2017-07-12 17:51:22 -07:00
|
|
|
[
|
2017-07-12 19:24:21 -07:00
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.fieldsets.index',
|
|
|
|
'show' => 'api.fieldsets.show',
|
|
|
|
'store' => 'api.fieldsets.store',
|
|
|
|
'update' => 'api.fieldsets.update',
|
|
|
|
'destroy' => 'api.fieldsets.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['fieldset' => 'fieldset_id']
|
|
|
|
]
|
|
|
|
); // Custom fieldset resource
|
|
|
|
|
2017-07-12 17:51:22 -07:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Groups API ---*/
|
|
|
|
|
|
|
|
Route::resource('groups', 'GroupsController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.groups.index',
|
|
|
|
'show' => 'api.groups.show',
|
|
|
|
'store' => 'api.groups.store',
|
|
|
|
'update' => 'api.groups.update',
|
|
|
|
'destroy' => 'api.groups.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['group' => 'group_id']
|
2017-01-12 19:41:01 -08:00
|
|
|
]
|
2017-02-23 16:32:35 -08:00
|
|
|
); // Groups resource
|
2017-01-12 19:41:01 -08:00
|
|
|
|
2017-01-13 03:19:39 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Hardware API ---*/
|
2017-02-01 17:59:03 -08:00
|
|
|
|
2017-03-11 14:04:52 -08:00
|
|
|
Route::group(['prefix' => 'hardware'], function () {
|
|
|
|
|
2018-03-23 14:50:11 -07:00
|
|
|
Route::get( 'bytag/{tag}', [
|
|
|
|
'as' => 'assets.show.bytag',
|
|
|
|
'uses' => 'AssetsController@showByTag'
|
|
|
|
]);
|
|
|
|
|
|
|
|
Route::get( 'byserial/{serial}', [
|
|
|
|
'as' => 'assets.show.byserial',
|
|
|
|
'uses' => 'AssetsController@showBySerial'
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
2017-10-26 02:28:17 -07:00
|
|
|
Route::get( 'selectlist', [
|
|
|
|
'as' => 'assets.selectlist',
|
|
|
|
'uses' => 'AssetsController@selectlist'
|
|
|
|
]);
|
|
|
|
|
2019-05-05 19:32:52 -07:00
|
|
|
Route::get('audit/{audit}', [
|
|
|
|
'as' => 'api.asset.to-audit',
|
|
|
|
'uses' => 'AssetsController@index'
|
|
|
|
]);
|
|
|
|
|
2017-10-26 02:28:17 -07:00
|
|
|
|
2017-08-29 16:00:22 -07:00
|
|
|
Route::post('audit', [
|
2017-08-25 10:04:19 -07:00
|
|
|
'as' => 'api.asset.audit',
|
|
|
|
'uses' => 'AssetsController@audit'
|
|
|
|
]);
|
|
|
|
|
2017-03-11 15:25:19 -08:00
|
|
|
Route::post('{asset_id}/checkout',
|
2017-03-11 14:04:52 -08:00
|
|
|
[
|
|
|
|
'as' => 'api.assets.checkout',
|
|
|
|
'uses' => 'AssetsController@checkout'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2017-03-11 15:25:19 -08:00
|
|
|
Route::post('{asset_id}/checkin',
|
2017-03-11 14:04:52 -08:00
|
|
|
[
|
|
|
|
'as' => 'api.assets.checkin',
|
|
|
|
'uses' => 'AssetsController@checkin'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2017-08-22 13:52:06 -07:00
|
|
|
/*--- Asset Maintenances API ---*/
|
|
|
|
Route::resource('maintenances', 'AssetMaintenancesController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.maintenances.index',
|
|
|
|
'show' => 'api.maintenances.show',
|
|
|
|
'store' => 'api.maintenances.store',
|
|
|
|
'update' => 'api.maintenances.update',
|
|
|
|
'destroy' => 'api.maintenances.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['maintenance' => 'maintenance_id']
|
|
|
|
]
|
|
|
|
); // Consumables resource
|
|
|
|
|
2017-03-11 14:04:52 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::resource('hardware', 'AssetsController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.assets.index',
|
|
|
|
'show' => 'api.assets.show',
|
|
|
|
'store' => 'api.assets.store',
|
|
|
|
'update' => 'api.assets.update',
|
|
|
|
'destroy' => 'api.assets.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['asset' => 'asset_id']
|
|
|
|
]
|
|
|
|
); // Hardware resource
|
2017-02-01 17:59:03 -08:00
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Imports API ---*/
|
2017-01-13 03:19:39 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::resource('imports', 'ImportController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.imports.index',
|
|
|
|
'show' => 'api.imports.show',
|
|
|
|
'store' => 'api.imports.store',
|
|
|
|
'update' => 'api.imports.update',
|
|
|
|
'destroy' => 'api.imports.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['import' => 'import_id']
|
|
|
|
]
|
|
|
|
); // Imports resource
|
2017-01-13 03:19:39 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::group(['prefix' => 'imports'], function () {
|
2017-01-18 20:41:40 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::post('process/{import}',
|
|
|
|
[
|
|
|
|
'as' => 'api.imports.importFile',
|
|
|
|
'uses'=> 'ImportController@process'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}); // Imports group
|
2017-01-13 03:19:39 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Licenses API ---*/
|
2017-01-13 03:19:39 -08:00
|
|
|
|
2018-01-10 18:47:27 -08:00
|
|
|
Route::group(['prefix' => 'licenses'], function () {
|
|
|
|
Route::get('{licenseId}/seats', [
|
|
|
|
'as' => 'api.license.seats',
|
|
|
|
'uses' => 'LicensesController@seats'
|
|
|
|
]);
|
|
|
|
}); // Licenses group
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::resource('licenses', 'LicensesController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.licenses.index',
|
|
|
|
'show' => 'api.licenses.show',
|
|
|
|
'store' => 'api.licenses.store',
|
|
|
|
'update' => 'api.licenses.update',
|
|
|
|
'destroy' => 'api.licenses.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['license' => 'license_id']
|
|
|
|
]
|
|
|
|
); // Licenses resource
|
2017-01-13 03:19:39 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
|
2018-01-10 18:47:27 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Locations API ---*/
|
|
|
|
|
|
|
|
Route::group(['prefix' => 'locations'], function () {
|
2017-01-13 03:19:39 -08:00
|
|
|
|
2017-08-25 06:04:22 -07:00
|
|
|
Route::get('{location}/users',
|
|
|
|
[
|
|
|
|
'as'=>'api.locations.viewusers',
|
|
|
|
'uses'=>'LocationsController@getDataViewUsers'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
Route::get('{location}/assets',
|
|
|
|
[
|
|
|
|
'as'=>'api.locations.viewassets',
|
|
|
|
'uses'=>'LocationsController@getDataViewAssets'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
// Do we actually still need this, now that we have an API?
|
|
|
|
Route::get('{location}/check',
|
2017-01-12 19:41:01 -08:00
|
|
|
[
|
2017-02-23 16:32:35 -08:00
|
|
|
'as' => 'api.locations.check',
|
|
|
|
'uses' => 'LocationsController@show'
|
|
|
|
]
|
|
|
|
);
|
2017-10-26 02:28:17 -07:00
|
|
|
|
|
|
|
Route::get( 'selectlist', [
|
|
|
|
'as' => 'locations.selectlist',
|
|
|
|
'uses' => 'LocationsController@selectlist'
|
|
|
|
]);
|
2017-02-23 16:32:35 -08:00
|
|
|
}); // Locations group
|
|
|
|
|
|
|
|
|
2017-10-26 02:28:17 -07:00
|
|
|
|
|
|
|
Route::resource('locations', 'LocationsController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.locations.index',
|
|
|
|
'show' => 'api.locations.show',
|
|
|
|
'store' => 'api.locations.store',
|
|
|
|
'update' => 'api.locations.update',
|
|
|
|
'destroy' => 'api.locations.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['location' => 'location_id']
|
|
|
|
]
|
|
|
|
); // Locations resource
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Manufacturers API ---*/
|
|
|
|
|
2017-10-26 22:09:08 -07:00
|
|
|
Route::group(['prefix' => 'manufacturers'], function () {
|
|
|
|
|
|
|
|
Route::get( 'selectlist', [
|
|
|
|
'as' => 'manufacturers.selectlist',
|
|
|
|
'uses' => 'ManufacturersController@selectlist'
|
|
|
|
]);
|
|
|
|
}); // Locations group
|
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::resource('manufacturers', 'ManufacturersController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.manufacturers.index',
|
|
|
|
'show' => 'api.manufacturers.show',
|
|
|
|
'store' => 'api.manufacturers.store',
|
|
|
|
'update' => 'api.manufacturers.update',
|
|
|
|
'destroy' => 'api.manufacturers.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
2017-01-13 09:37:06 -08:00
|
|
|
'parameters' => ['manufacturer' => 'manufacturer_id']
|
2017-01-12 19:41:01 -08:00
|
|
|
]
|
2017-02-23 16:32:35 -08:00
|
|
|
); // Manufacturers resource
|
2017-01-12 19:41:01 -08:00
|
|
|
|
2017-01-25 02:19:26 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Models API ---*/
|
2017-01-25 02:19:26 -08:00
|
|
|
|
2017-10-26 21:51:09 -07:00
|
|
|
Route::group(['prefix' => 'models'], function () {
|
|
|
|
|
|
|
|
Route::get('assets',
|
|
|
|
[
|
|
|
|
'as' => 'api.models.assets',
|
|
|
|
'uses'=> 'AssetModelsController@assets'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
Route::get('selectlist',
|
|
|
|
[
|
|
|
|
'as' => 'api.models.selectlist',
|
|
|
|
'uses'=> 'AssetModelsController@selectlist'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}); // Models group
|
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::resource('models', 'AssetModelsController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.models.index',
|
|
|
|
'show' => 'api.models.show',
|
|
|
|
'store' => 'api.models.store',
|
|
|
|
'update' => 'api.models.update',
|
|
|
|
'destroy' => 'api.models.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['model' => 'model_id']
|
|
|
|
]
|
|
|
|
); // Models resource
|
2017-01-25 02:19:26 -08:00
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
|
|
|
|
|
|
|
|
/*--- Settings API ---*/
|
2017-10-16 05:52:18 -07:00
|
|
|
Route::get('settings/ldaptest', [
|
|
|
|
'as' => 'api.settings.ldaptest',
|
|
|
|
'uses' => 'SettingsController@ldaptest'
|
|
|
|
]);
|
2017-10-16 06:34:04 -07:00
|
|
|
|
|
|
|
Route::post('settings/ldaptestlogin', [
|
|
|
|
'as' => 'api.settings.ldaptestlogin',
|
|
|
|
'uses' => 'SettingsController@ldaptestlogin'
|
|
|
|
]);
|
2017-10-19 08:18:56 -07:00
|
|
|
|
2018-02-22 16:35:34 -08:00
|
|
|
Route::post('settings/slacktest', [
|
|
|
|
'as' => 'api.settings.slacktest',
|
|
|
|
'uses' => 'SettingsController@slacktest'
|
|
|
|
]);
|
|
|
|
|
2017-10-19 08:18:56 -07:00
|
|
|
Route::post(
|
|
|
|
'settings/mailtest',
|
|
|
|
[
|
|
|
|
'as' => 'api.settings.mailtest',
|
|
|
|
'uses' => 'SettingsController@ajaxTestEmail' ]
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::resource('settings', 'SettingsController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.settings.index',
|
|
|
|
'store' => 'api.settings.store',
|
|
|
|
'show' => 'api.settings.show',
|
|
|
|
'update' => 'api.settings.update'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit', 'destroy'],
|
|
|
|
'parameters' => ['setting' => 'setting_id']
|
2017-01-12 19:41:01 -08:00
|
|
|
]
|
2017-02-23 16:32:35 -08:00
|
|
|
); // Settings resource
|
2017-01-12 19:41:01 -08:00
|
|
|
|
2017-10-16 05:52:18 -07:00
|
|
|
|
2017-07-07 23:44:48 -07:00
|
|
|
|
2017-01-12 19:41:01 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Status Labels API ---*/
|
2017-01-12 19:41:01 -08:00
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::group(['prefix' => 'statuslabels'], function () {
|
2017-01-12 02:20:32 -08:00
|
|
|
|
2017-04-06 21:18:35 -07:00
|
|
|
// Pie chart for dashboard
|
|
|
|
Route::get('assets',
|
|
|
|
[
|
|
|
|
'as' => 'api.statuslabels.assets.bytype',
|
|
|
|
'uses' => 'StatuslabelsController@getAssetCountByStatuslabel'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::get('{statuslabel}/assetlist',
|
|
|
|
[
|
|
|
|
'as' => 'api.statuslabels.assets',
|
|
|
|
'uses' => 'StatuslabelsController@assets'
|
|
|
|
]
|
|
|
|
);
|
2017-01-11 18:14:06 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::get('{statuslabel}/deployable',
|
|
|
|
[
|
|
|
|
'as' => 'api.statuslabels.deployable',
|
|
|
|
'uses' => 'StatuslabelsController@checkIfDeployable'
|
|
|
|
]
|
|
|
|
);
|
2017-01-11 18:14:06 -08:00
|
|
|
|
2017-04-06 21:18:35 -07:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
Route::resource('statuslabels', 'StatuslabelsController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.statuslabels.index',
|
|
|
|
'store' => 'api.statuslabels.store',
|
|
|
|
'show' => 'api.statuslabels.show',
|
|
|
|
'update' => 'api.statuslabels.update',
|
|
|
|
'destroy' => 'api.statuslabels.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['statuslabel' => 'statuslabel_id']
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
// Status labels group
|
2017-01-11 18:14:06 -08:00
|
|
|
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
/*--- Suppliers API ---*/
|
2017-10-28 08:38:00 -07:00
|
|
|
Route::group(['prefix' => 'suppliers'], function () {
|
|
|
|
|
|
|
|
Route::get('list',
|
|
|
|
[
|
|
|
|
'as'=>'api.suppliers.list',
|
|
|
|
'uses'=>'SuppliersController@getDatatable'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
Route::get('selectlist',
|
|
|
|
[
|
|
|
|
'as' => 'api.suppliers.selectlist',
|
|
|
|
'uses' => 'SuppliersController@selectlist'
|
|
|
|
]
|
|
|
|
);
|
2017-10-28 09:21:39 -07:00
|
|
|
}); // Suppliers group
|
2017-10-28 08:38:00 -07:00
|
|
|
|
2017-01-12 23:41:08 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::resource('suppliers', 'SuppliersController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.suppliers.index',
|
|
|
|
'show' => 'api.suppliers.show',
|
|
|
|
'store' => 'api.suppliers.store',
|
|
|
|
'update' => 'api.suppliers.update',
|
|
|
|
'destroy' => 'api.suppliers.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['supplier' => 'supplier_id']
|
|
|
|
]
|
|
|
|
); // Suppliers resource
|
2017-01-24 17:37:07 -08:00
|
|
|
|
2016-12-14 10:54:05 -08:00
|
|
|
|
|
|
|
|
2017-10-24 19:24:35 -07:00
|
|
|
|
2018-07-02 20:35:10 -07:00
|
|
|
/*--- Users API ---*/
|
2016-12-14 10:54:05 -08:00
|
|
|
|
2018-07-02 20:35:10 -07:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::group([ 'prefix' => 'users' ], function () {
|
2017-01-12 23:41:08 -08:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::post('two_factor_reset',
|
|
|
|
[
|
|
|
|
'as' => 'api.users.two_factor_reset',
|
|
|
|
'uses' => 'UsersController@postTwoFactorReset'
|
|
|
|
]
|
|
|
|
);
|
2016-12-14 10:54:05 -08:00
|
|
|
|
2018-07-02 20:35:10 -07:00
|
|
|
Route::get('me',
|
|
|
|
[
|
|
|
|
'as' => 'api.users.me',
|
|
|
|
'uses' => 'UsersController@getCurrentUserInfo'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::get('list/{status?}',
|
|
|
|
[
|
|
|
|
'as' => 'api.users.list',
|
|
|
|
'uses' => 'UsersController@getDatatable'
|
|
|
|
]
|
|
|
|
);
|
2016-12-14 10:54:05 -08:00
|
|
|
|
2017-10-24 19:24:35 -07:00
|
|
|
Route::get('selectlist',
|
|
|
|
[
|
|
|
|
'as' => 'api.users.selectlist',
|
|
|
|
'uses' => 'UsersController@selectList'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::get('{user}/assets',
|
|
|
|
[
|
|
|
|
'as' => 'api.users.assetlist',
|
2017-08-26 15:21:38 -07:00
|
|
|
'uses' => 'UsersController@assets'
|
2017-02-23 16:32:35 -08:00
|
|
|
]
|
|
|
|
);
|
2017-01-18 04:58:56 -08:00
|
|
|
|
2019-03-01 17:21:03 -08:00
|
|
|
Route::get('{user}/accessories',
|
|
|
|
[
|
|
|
|
'as' => 'api.users.accessorieslist',
|
|
|
|
'uses' => 'UsersController@accessories'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
Route::post('{user}/upload',
|
|
|
|
[
|
|
|
|
'as' => 'api.users.uploads',
|
|
|
|
'uses' => 'UsersController@postUpload'
|
|
|
|
]
|
2017-01-18 04:58:56 -08:00
|
|
|
);
|
2017-02-23 16:32:35 -08:00
|
|
|
}); // Users group
|
2017-01-18 04:58:56 -08:00
|
|
|
|
2017-10-24 19:24:35 -07:00
|
|
|
Route::resource('users', 'UsersController',
|
|
|
|
[
|
|
|
|
'names' =>
|
|
|
|
[
|
|
|
|
'index' => 'api.users.index',
|
|
|
|
'show' => 'api.users.show',
|
|
|
|
'store' => 'api.users.store',
|
|
|
|
'update' => 'api.users.update',
|
|
|
|
'destroy' => 'api.users.destroy'
|
|
|
|
],
|
|
|
|
'except' => ['create', 'edit'],
|
|
|
|
'parameters' => ['user' => 'user_id']
|
|
|
|
]
|
|
|
|
); // Users resource
|
|
|
|
|
2017-01-18 04:58:56 -08:00
|
|
|
|
2017-05-23 09:24:53 -07:00
|
|
|
Route::get(
|
|
|
|
'reports/activity',
|
2017-05-23 14:33:36 -07:00
|
|
|
[ 'as' => 'api.activity.index', 'uses' => 'ReportsController@index' ]
|
2017-05-23 09:24:53 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2018-04-04 17:33:02 -07:00
|
|
|
|
2017-02-23 16:32:35 -08:00
|
|
|
});
|