2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
2017-01-13 00:13:57 -08:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2017-03-11 05:16:56 -08:00
|
|
|
Route::group(['middleware' => 'auth'], function () {
|
2017-05-22 21:31:47 -07:00
|
|
|
/*
|
|
|
|
* Companies
|
|
|
|
*/
|
|
|
|
Route::resource('companies', 'CompaniesController', [
|
|
|
|
'parameters' => ['company' => 'company_id']
|
|
|
|
]);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Categories
|
|
|
|
*/
|
|
|
|
Route::resource('categories', 'CategoriesController', [
|
|
|
|
'parameters' => ['category' => 'category_id']
|
|
|
|
]);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Locations
|
|
|
|
*/
|
|
|
|
Route::resource('locations', 'LocationsController', [
|
|
|
|
'parameters' => ['location' => 'location_id']
|
|
|
|
]);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Manufacturers
|
|
|
|
*/
|
|
|
|
Route::resource('manufacturers', 'ManufacturersController', [
|
|
|
|
'parameters' => ['manufacturer' => 'manufacturers_id']
|
|
|
|
]);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Suppliers
|
|
|
|
*/
|
|
|
|
Route::resource('suppliers', 'SuppliersController', [
|
|
|
|
'parameters' => ['supplier' => 'supplier_id']
|
|
|
|
]);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Depreciations
|
|
|
|
*/
|
|
|
|
Route::resource('depreciations', 'DepreciationsController', [
|
|
|
|
'parameters' => ['depreciation' => 'depreciation_id']
|
|
|
|
]);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Status Labels
|
|
|
|
*/
|
|
|
|
Route::resource('statuslabels', 'StatuslabelsController', [
|
|
|
|
'parameters' => ['statuslabel' => 'statuslabel_id']
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Status Labels
|
|
|
|
*/
|
|
|
|
Route::resource('components', 'ComponentsController', [
|
|
|
|
'parameters' => ['component' => 'component_id']
|
|
|
|
]);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Departments
|
|
|
|
*/
|
|
|
|
Route::resource('departments', 'DepartmentsController', [
|
|
|
|
'parameters' => ['department' => 'department_id']
|
|
|
|
]);
|
2016-12-15 17:12:22 -08:00
|
|
|
|
2017-01-13 00:13:57 -08:00
|
|
|
|
2017-03-11 05:16:56 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2017-01-13 00:13:57 -08:00
|
|
|
|
2016-10-31 21:00:30 -07:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Log Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Register all the admin routes.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
Route::group(['middleware' => 'auth'], function () {
|
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'display-sig/{filename}',
|
|
|
|
[
|
|
|
|
'as' => 'log.signature.view',
|
|
|
|
'uses' => 'ActionlogController@displaySig' ]
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Admin Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Register all the admin routes.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2017-03-11 05:16:56 -08:00
|
|
|
Route::group([ 'prefix' => 'admin','middleware' => ['auth']], function () {
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-09-15 19:58:27 -07:00
|
|
|
Route::get('requests',
|
|
|
|
// foreach( CheckoutRequest::with('user')->get() as $requestedItem) {
|
|
|
|
// echo $requestedItem->user->username . ' requested ' . $requestedItem->requestedItem->name;
|
|
|
|
[
|
|
|
|
'as' => 'requests',
|
|
|
|
'middleware' => 'authorize:admin',
|
|
|
|
'uses' => 'ViewAssetsController@getRequestedIndex'
|
|
|
|
]);
|
2016-08-02 00:54:38 -07:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
# Admin Settings Routes (for categories, maufactureres, etc)
|
2016-06-02 02:50:00 -07:00
|
|
|
Route::group([ 'prefix' => 'settings', 'middleware'=>'authorize:superuser'], function () {
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
# Settings
|
|
|
|
Route::group([ 'prefix' => 'app' ], function () {
|
|
|
|
|
2017-01-24 17:37:07 -08:00
|
|
|
Route::get('api', [ 'as' => 'settings.api', 'uses' => 'SettingsController@api' ]);
|
2016-04-19 04:36:07 -07:00
|
|
|
Route::post('purge', ['as' => 'purge', 'uses' => 'SettingsController@postPurge']);
|
2016-03-25 01:18:05 -07:00
|
|
|
Route::get('edit', [ 'as' => 'edit/settings', 'uses' => 'SettingsController@getEdit' ]);
|
|
|
|
Route::post('edit', 'SettingsController@postEdit');
|
2016-07-13 05:50:40 -07:00
|
|
|
|
|
|
|
Route::get('ldaptest', [
|
|
|
|
'as' => 'settings/ldaptest',
|
|
|
|
'uses' => 'SettingsController@getLdapTest'
|
|
|
|
]);
|
|
|
|
|
|
|
|
Route::get('/', [ 'as' => 'app', 'uses' => 'SettingsController@getIndex' ]);
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|
|
|
|
|
2016-07-13 05:50:40 -07:00
|
|
|
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
# Settings
|
|
|
|
Route::group([ 'prefix' => 'backups', 'middleware' => 'auth' ], function () {
|
|
|
|
|
|
|
|
|
|
|
|
Route::get('download/{filename}', [
|
|
|
|
'as' => 'settings/download-file',
|
|
|
|
'uses' => 'SettingsController@downloadFile' ]);
|
|
|
|
|
2017-06-09 12:44:11 -07:00
|
|
|
Route::delete('delete/{filename}', [
|
2016-03-25 01:18:05 -07:00
|
|
|
'as' => 'settings/delete-file',
|
|
|
|
'uses' => 'SettingsController@deleteFile' ]);
|
|
|
|
|
|
|
|
Route::post('/', [
|
|
|
|
'as' => 'settings/backups',
|
|
|
|
'uses' => 'SettingsController@postBackups'
|
|
|
|
]);
|
2016-07-13 05:50:40 -07:00
|
|
|
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
Route::get('/', [ 'as' => 'settings/backups', 'uses' => 'SettingsController@getBackups' ]);
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
# Dashboard
|
|
|
|
Route::get('/', [ 'as' => 'admin', 'uses' => 'DashboardController@getIndex' ]);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2017-02-01 18:50:28 -08:00
|
|
|
|
2017-06-08 20:24:26 -07:00
|
|
|
Route::resource('groups', 'GroupsController', [
|
|
|
|
'middleware' => ['auth'],
|
|
|
|
'parameters' => ['group' => 'group_id']
|
|
|
|
]);
|
|
|
|
|
2017-02-01 18:50:28 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Account Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
2017-03-11 05:16:56 -08:00
|
|
|
Route::group([ 'prefix' => 'account', 'middleware' => ['auth']], function () {
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
# Profile
|
|
|
|
Route::get('profile', [ 'as' => 'profile', 'uses' => 'ProfileController@getIndex' ]);
|
|
|
|
Route::post('profile', 'ProfileController@postIndex');
|
2017-01-24 17:37:07 -08:00
|
|
|
Route::get('api', [ 'as' => 'user.api', 'uses' => 'ProfileController@api' ]);
|
2017-01-11 03:38:55 -08:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
# View Assets
|
|
|
|
Route::get('view-assets', [ 'as' => 'view-assets', 'uses' => 'ViewAssetsController@getIndex' ]);
|
|
|
|
|
|
|
|
# Accept Asset
|
|
|
|
Route::get(
|
|
|
|
'accept-asset/{logID}',
|
|
|
|
[ 'as' => 'account/accept-assets', 'uses' => 'ViewAssetsController@getAcceptAsset' ]
|
|
|
|
);
|
|
|
|
Route::post(
|
|
|
|
'accept-asset/{logID}',
|
|
|
|
[ 'as' => 'account/asset-accepted', 'uses' => 'ViewAssetsController@postAcceptAsset' ]
|
|
|
|
);
|
|
|
|
|
|
|
|
# Profile
|
|
|
|
Route::get(
|
|
|
|
'requestable-assets',
|
|
|
|
[ 'as' => 'requestable-assets', 'uses' => 'ViewAssetsController@getRequestableIndex' ]
|
|
|
|
);
|
|
|
|
Route::get(
|
|
|
|
'request-asset/{assetId}',
|
|
|
|
[ 'as' => 'account/request-asset', 'uses' => 'ViewAssetsController@getRequestAsset' ]
|
|
|
|
);
|
|
|
|
|
2016-09-15 19:58:27 -07:00
|
|
|
Route::post(
|
|
|
|
'request/{itemType}/{itemId}',
|
|
|
|
[ 'as' => 'account/request-item', 'uses' => 'ViewAssetsController@getRequestItem']
|
|
|
|
);
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
# Account Dashboard
|
2016-06-10 08:29:43 -07:00
|
|
|
Route::get('/', [ 'as' => 'account', 'uses' => 'ViewAssetsController@getIndex' ]);
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2017-03-11 05:16:56 -08:00
|
|
|
Route::group(['middleware' => ['auth']], function () {
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'reports/depreciation',
|
|
|
|
[ 'as' => 'reports/depreciation', 'uses' => 'ReportsController@getDeprecationReport' ]
|
|
|
|
);
|
|
|
|
Route::get(
|
|
|
|
'reports/export/depreciation',
|
|
|
|
[ 'as' => 'reports/export/depreciation', 'uses' => 'ReportsController@exportDeprecationReport' ]
|
|
|
|
);
|
|
|
|
Route::get(
|
|
|
|
'reports/asset_maintenances',
|
|
|
|
[ 'as' => 'reports/asset_maintenances', 'uses' => 'ReportsController@getAssetMaintenancesReport' ]
|
|
|
|
);
|
|
|
|
Route::get(
|
|
|
|
'reports/export/asset_maintenances',
|
|
|
|
[
|
|
|
|
'as' => 'reports/export/asset_maintenances',
|
|
|
|
'uses' => 'ReportsController@exportAssetMaintenancesReport'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
Route::get(
|
|
|
|
'reports/licenses',
|
|
|
|
[ 'as' => 'reports/licenses', 'uses' => 'ReportsController@getLicenseReport' ]
|
|
|
|
);
|
|
|
|
Route::get(
|
|
|
|
'reports/export/licenses',
|
|
|
|
[ 'as' => 'reports/export/licenses', 'uses' => 'ReportsController@exportLicenseReport' ]
|
|
|
|
);
|
|
|
|
Route::get('reports/assets', [ 'as' => 'reports/assets', 'uses' => 'ReportsController@getAssetsReport' ]);
|
|
|
|
Route::get(
|
|
|
|
'reports/export/assets',
|
|
|
|
[ 'as' => 'reports/export/assets', 'uses' => 'ReportsController@exportAssetReport' ]
|
|
|
|
);
|
|
|
|
Route::get('reports/accessories', [ 'as' => 'reports/accessories', 'uses' => 'ReportsController@getAccessoryReport' ]);
|
|
|
|
Route::get(
|
|
|
|
'reports/export/accessories',
|
|
|
|
[ 'as' => 'reports/export/accessories', 'uses' => 'ReportsController@exportAccessoryReport' ]
|
|
|
|
);
|
|
|
|
Route::get('reports/custom', [ 'as' => 'reports/custom', 'uses' => 'ReportsController@getCustomReport' ]);
|
|
|
|
Route::post('reports/custom', 'ReportsController@postCustom');
|
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'reports/activity',
|
|
|
|
[ 'as' => 'reports/activity', 'uses' => 'ReportsController@getActivityReport' ]
|
|
|
|
);
|
2016-09-19 23:52:01 -07:00
|
|
|
|
2016-12-14 04:32:10 -08:00
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
Route::get(
|
|
|
|
'reports/unaccepted_assets',
|
|
|
|
[ 'as' => 'reports/unaccepted_assets', 'uses' => 'ReportsController@getAssetAcceptanceReport' ]
|
|
|
|
);
|
|
|
|
Route::get(
|
|
|
|
'reports/export/unaccepted_assets',
|
|
|
|
[ 'as' => 'reports/export/unaccepted_assets', 'uses' => 'ReportsController@exportAssetAcceptanceReport' ]
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2017-02-02 18:14:25 -08:00
|
|
|
Route::get(
|
|
|
|
'auth/signin',
|
|
|
|
['uses' => 'Auth\LoginController@legacyAuthRedirect' ]
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Setup Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
2016-05-14 17:25:56 -07:00
|
|
|
Route::group([ 'prefix' => 'setup', 'middleware' => 'web'], function () {
|
2016-03-25 01:18:05 -07:00
|
|
|
Route::get(
|
|
|
|
'user',
|
|
|
|
[
|
|
|
|
'as' => 'setup.user',
|
|
|
|
'uses' => 'SettingsController@getSetupUser' ]
|
|
|
|
);
|
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'user',
|
|
|
|
[
|
|
|
|
'as' => 'setup.user.save',
|
|
|
|
'uses' => 'SettingsController@postSaveFirstAdmin' ]
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'migrate',
|
|
|
|
[
|
|
|
|
'as' => 'setup.migrate',
|
|
|
|
'uses' => 'SettingsController@getSetupMigrate' ]
|
|
|
|
);
|
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'done',
|
|
|
|
[
|
|
|
|
'as' => 'setup.done',
|
|
|
|
'uses' => 'SettingsController@getSetupDone' ]
|
|
|
|
);
|
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'mailtest',
|
|
|
|
[
|
|
|
|
'as' => 'setup.mailtest',
|
|
|
|
'uses' => 'SettingsController@ajaxTestEmail' ]
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'/',
|
|
|
|
[
|
|
|
|
'as' => 'setup',
|
|
|
|
'uses' => 'SettingsController@getSetupIndex' ]
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2016-10-29 05:50:55 -07:00
|
|
|
Route::get(
|
|
|
|
'two-factor-enroll',
|
|
|
|
[
|
|
|
|
'as' => 'two-factor-enroll',
|
|
|
|
'middleware' => ['web'],
|
2016-12-14 04:32:10 -08:00
|
|
|
'uses' => 'Auth\LoginController@getTwoFactorEnroll' ]
|
2016-10-29 05:50:55 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'two-factor',
|
|
|
|
[
|
|
|
|
'as' => 'two-factor',
|
|
|
|
'middleware' => ['web'],
|
2016-12-14 04:32:10 -08:00
|
|
|
'uses' => 'Auth\LoginController@getTwoFactorAuth' ]
|
2016-10-29 05:50:55 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'two-factor',
|
|
|
|
[
|
|
|
|
'as' => 'two-factor',
|
|
|
|
'middleware' => ['web'],
|
2016-12-14 04:32:10 -08:00
|
|
|
'uses' => 'Auth\LoginController@postTwoFactorAuth' ]
|
2016-10-29 05:50:55 -07:00
|
|
|
);
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
Route::get(
|
|
|
|
'/',
|
|
|
|
[
|
|
|
|
'as' => 'home',
|
2017-03-11 05:16:56 -08:00
|
|
|
'middleware' => ['auth'],
|
2016-03-25 01:18:05 -07:00
|
|
|
'uses' => 'DashboardController@getIndex' ]
|
|
|
|
);
|
|
|
|
|
2016-10-29 05:50:55 -07:00
|
|
|
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
Route::group(['middleware' => 'web'], function () {
|
2016-12-15 04:12:18 -08:00
|
|
|
//Route::auth();
|
2016-10-29 05:50:55 -07:00
|
|
|
Route::get(
|
|
|
|
'login',
|
|
|
|
[
|
|
|
|
'as' => 'login',
|
|
|
|
'middleware' => ['web'],
|
2016-12-14 04:32:10 -08:00
|
|
|
'uses' => 'Auth\LoginController@showLoginForm' ]
|
2016-10-29 05:50:55 -07:00
|
|
|
);
|
2016-12-15 04:12:18 -08:00
|
|
|
|
|
|
|
Route::post(
|
|
|
|
'login',
|
|
|
|
[
|
|
|
|
'as' => 'login',
|
|
|
|
'middleware' => ['web'],
|
|
|
|
'uses' => 'Auth\LoginController@login' ]
|
|
|
|
);
|
|
|
|
|
2016-10-29 05:50:55 -07:00
|
|
|
Route::get(
|
|
|
|
'logout',
|
|
|
|
[
|
|
|
|
'as' => 'logout',
|
2016-12-14 04:32:10 -08:00
|
|
|
'uses' => 'Auth\LoginController@logout' ]
|
2016-10-29 05:50:55 -07:00
|
|
|
);
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|
|
|
|
|
2017-05-09 00:37:37 -07:00
|
|
|
|
2017-05-23 09:24:53 -07:00
|
|
|
|
2017-05-09 00:37:37 -07:00
|
|
|
|