diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index f7742a6b25..57e9505d3f 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -10,15 +10,6 @@ use Illuminate\Support\Facades\Route; class RouteServiceProvider extends ServiceProvider { - /** - * This namespace is applied to your controller routes. - * - * In addition, it is set as the URL generator's root namespace. - * - * @var string - */ - protected $namespace = 'App\Http\Controllers'; - /** * Define your route model bindings, pattern filters, etc. * diff --git a/routes/api.php b/routes/api.php index ddc512721f..df2570c9ef 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,5 +1,8 @@ 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api'], function () { +Route::group(['prefix' => 'v1', 'middleware' => 'auth:api'], function () { Route::get('/', function () { return response()->json( [ @@ -27,14 +30,14 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('requestable/hardware', [ 'as' => 'api.assets.requestable', - 'uses' => 'AssetsController@requestable', + 'uses' => [Api\AssetsController::class, 'requestable'], ] ); Route::get('requests', [ 'as' => 'api.assets.requested', - 'uses' => 'ProfileController@requestedAssets', + 'uses' => [Api\ProfileController::class, 'requestedAssets'], ] ); }); @@ -44,20 +47,20 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('{accessory}/checkedout', [ 'as' => 'api.accessories.checkedout', - 'uses' => 'AccessoriesController@checkedout', + 'uses' => [Api\AccessoriesController::class, 'checkedout'], ] ); Route::get('selectlist', [ 'as' => 'api.accessories.selectlist', - 'uses'=> 'AccessoriesController@selectlist', + 'uses'=> [Api\AccessoriesController::class, 'selectlist'], ] ); }); // Accessories group - Route::resource('accessories', 'AccessoriesController', + Route::resource('accessories', Api\AccessoriesController::class, ['names' => [ 'index' => 'api.accessories.index', 'show' => 'api.accessories.show', @@ -76,21 +79,21 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('{accessory}/checkedout', [ 'as' => 'api.accessories.checkedout', - 'uses' => 'AccessoriesController@checkedout', + 'uses' => [Api\AccessoriesController::class, 'checkedout'], ] ); Route::post('{accessory}/checkout', [ 'as' => 'api.accessories.checkout', - 'uses' => 'AccessoriesController@checkout', + 'uses' => [Api\AccessoriesController::class, 'checkout'], ] ); Route::post('{accessory}/checkin', [ 'as' => 'api.accessories.checkin', - 'uses' => 'AccessoriesController@checkin', + 'uses' => [Api\AccessoriesController::class, 'checkin'], ] ); }); // Accessories group @@ -101,13 +104,13 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('{item_type}/selectlist', [ 'as' => 'api.categories.selectlist', - 'uses' => 'CategoriesController@selectlist', + 'uses' => [Api\CategoriesController::class, 'selectlist'], ] ); }); // Categories group - Route::resource('categories', 'CategoriesController', + Route::resource('categories', Api\CategoriesController::class, [ 'names' => [ 'index' => 'api.categories.index', @@ -125,11 +128,11 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('companies/selectlist', [ 'as' => 'companies.selectlist', - 'uses' => 'CompaniesController@selectlist', + 'uses' => [Api\CompaniesController::class, 'selectlist'], ]); // Companies resource - Route::resource('companies', 'CompaniesController', + Route::resource('companies', Api\CompaniesController::class, [ 'names' => [ 'index' => 'api.companies.index', @@ -149,12 +152,12 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('selectlist', [ 'as' => 'api.departments.selectlist', - 'uses' => 'DepartmentsController@selectlist', + 'uses' => [Api\DepartmentsController::class, 'selectlist'], ] ); }); // Departments group - Route::resource('departments', 'DepartmentsController', + Route::resource('departments', Api\DepartmentsController::class, [ 'names' => [ 'index' => 'api.departments.index', @@ -170,7 +173,7 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' /*--- Components API ---*/ - Route::resource('components', 'ComponentsController', + Route::resource('components', Api\ComponentsController::class, [ 'names' => [ 'index' => 'api.components.index', @@ -188,7 +191,7 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('{component}/assets', [ 'as' =>'api.components.assets', - 'uses' => 'ComponentsController@getAssets', + 'uses' => [Api\ComponentsController::class, 'getAssets'], ] ); }); // Components group @@ -197,11 +200,11 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('consumables/selectlist', [ 'as' => 'api.consumables.selectlist', - 'uses'=> 'ConsumablesController@selectlist', + 'uses'=> [Api\ConsumablesController::class, 'selectlist'], ] ); - Route::resource('consumables', 'ConsumablesController', + Route::resource('consumables', Api\ConsumablesController::class, [ 'names' => [ 'index' => 'api.consumables.index', @@ -219,21 +222,21 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('view/{id}/users', [ 'as' => 'api.consumables.showUsers', - 'uses' => 'ConsumablesController@getDataView', + 'uses' => [Api\ConsumablesController::class, 'getDataView'], ] ); Route::post('{consumable}/checkout', [ 'as' => 'api.consumables.checkout', - 'uses' => 'ConsumablesController@checkout', + 'uses' => [Api\ConsumablesController::class, 'checkout'], ] ); }); /*--- Depreciations API ---*/ - Route::resource('depreciations', 'DepreciationsController', + Route::resource('depreciations', Api\DepreciationsController::class, [ 'names' => [ 'index' => 'api.depreciations.index', @@ -249,7 +252,7 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' /*--- Fields API ---*/ - Route::resource('fields', 'CustomFieldsController', [ + Route::resource('fields', Api\CustomFieldsController::class, [ 'names' => [ 'index' => 'api.customfields.index', 'show' => 'api.customfields.show', @@ -265,19 +268,19 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::post('fieldsets/{id}/order', [ 'as' => 'api.customfields.order', - 'uses' => 'CustomFieldsController@postReorder', + 'uses' => [Api\CustomFieldsController::class, 'postReorder'], ] ); Route::post('{field}/associate', [ 'as' => 'api.customfields.associate', - 'uses' => 'CustomFieldsController@associate', + 'uses' => [Api\CustomFieldsController::class, 'associate'], ] ); Route::post('{field}/disassociate', [ 'as' => 'api.customfields.disassociate', - 'uses' => 'CustomFieldsController@disassociate', + 'uses' => [Api\CustomFieldsController::class, 'disassociate'], ] ); }); // Fields group @@ -288,18 +291,18 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('{fieldset}/fields', [ 'as' => 'api.fieldsets.fields', - 'uses' => 'CustomFieldsetsController@fields', + 'uses' => [Api\CustomFieldsetsController::class, 'fields'], ] ); Route::get('/{fieldset}/fields/{model}', [ 'as' => 'api.fieldsets.fields-with-default-value', - 'uses' => 'CustomFieldsetsController@fieldsWithDefaultValues', + 'uses' => [Api\CustomFieldsetsController::class, 'fieldsWithDefaultValues'], ] ); }); - Route::resource('fieldsets', 'CustomFieldsetsController', + Route::resource('fieldsets', Api\CustomFieldsetsController::class, [ 'names' => [ 'index' => 'api.fieldsets.index', @@ -315,7 +318,7 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' /*--- Groups API ---*/ - Route::resource('groups', 'GroupsController', + Route::resource('groups', Api\GroupsController::class, [ 'names' => [ 'index' => 'api.groups.index', @@ -334,60 +337,60 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::group(['prefix' => 'hardware'], function () { Route::get('{asset_id}/licenses', [ 'as' => 'api.assets.licenselist', - 'uses' => 'AssetsController@licenses', + 'uses' => [Api\AssetsController::class, 'licenses'], ]); Route::get('bytag/{tag}', [ 'as' => 'assets.show.bytag', - 'uses' => 'AssetsController@showByTag', + 'uses' => [Api\AssetsController::class, 'showByTag'], ]); Route::get('bytag/{any}', [ 'as' => 'api.assets.show.bytag', - 'uses' => 'AssetsController@showByTag', + 'uses' => [Api\AssetsController::class, 'showByTag'], ] )->where('any', '.*'); Route::get('byserial/{any}', [ 'as' => 'api.assets.show.byserial', - 'uses' => 'AssetsController@showBySerial', + 'uses' => [Api\AssetsController::class, 'showBySerial'], ] )->where('any', '.*'); Route::get('selectlist', [ 'as' => 'assets.selectlist', - 'uses' => 'AssetsController@selectlist', + 'uses' => [Api\AssetsController::class, 'selectlist'], ]); Route::get('audit/{audit}', [ 'as' => 'api.asset.to-audit', - 'uses' => 'AssetsController@index', + 'uses' => [Api\AssetsController::class, 'index'], ]); Route::post('audit', [ 'as' => 'api.asset.audit', - 'uses' => 'AssetsController@audit', + 'uses' => [Api\AssetsController::class, 'audit'], ]); Route::post('{asset_id}/checkout', [ 'as' => 'api.assets.checkout', - 'uses' => 'AssetsController@checkout', + 'uses' => [Api\AssetsController::class, 'checkout'], ] ); Route::post('{asset_id}/checkin', [ 'as' => 'api.assets.checkin', - 'uses' => 'AssetsController@checkin', + 'uses' => [Api\AssetsController::class, 'checkin'], ] ); }); /*--- Asset Maintenances API ---*/ - Route::resource('maintenances', 'AssetMaintenancesController', + Route::resource('maintenances', Api\AssetMaintenancesController::class, [ 'names' => [ 'index' => 'api.maintenances.index', @@ -401,7 +404,7 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' ] ); // Consumables resource - Route::resource('hardware', 'AssetsController', + Route::resource('hardware', Api\AssetsController::class, [ 'names' => [ 'index' => 'api.assets.index', @@ -417,7 +420,7 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' /*--- Imports API ---*/ - Route::resource('imports', 'ImportController', + Route::resource('imports', Api\ImportController::class, [ 'names' => [ 'index' => 'api.imports.index', @@ -435,7 +438,7 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::post('process/{import}', [ 'as' => 'api.imports.importFile', - 'uses'=> 'ImportController@process', + 'uses'=> [Api\ImportController::class, 'process'], ] ); }); // Imports group @@ -446,12 +449,12 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('selectlist', [ 'as' => 'api.licenses.selectlist', - 'uses'=> 'LicensesController@selectlist', + 'uses'=> [Api\LicensesController::class, 'selectlist'], ] ); }); // Licenses group - Route::resource('licenses', 'LicensesController', + Route::resource('licenses', Api\LicensesController::class, [ 'names' => [ 'index' => 'api.licenses.index', @@ -465,7 +468,7 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' ] ); // Licenses resource - Route::resource('licenses.seats', 'LicenseSeatsController', + Route::resource('licenses.seats', Api\LicenseSeatsController::class, [ 'names' => [ 'index' => 'api.licenses.seats.index', @@ -483,14 +486,14 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('{location}/users', [ 'as'=>'api.locations.viewusers', - 'uses'=>'LocationsController@getDataViewUsers', + 'uses'=>[Api\LocationsController::class, 'getDataViewUsers'], ] ); Route::get('{location}/assets', [ 'as'=>'api.locations.viewassets', - 'uses'=>'LocationsController@getDataViewAssets', + 'uses'=>[Api\LocationsController::class, 'getDataViewAssets'], ] ); @@ -498,17 +501,17 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('{location}/check', [ 'as' => 'api.locations.check', - 'uses' => 'LocationsController@show', + 'uses' => [Api\LocationsController::class, 'show'], ] ); Route::get('selectlist', [ 'as' => 'locations.selectlist', - 'uses' => 'LocationsController@selectlist', + 'uses' => [Api\LocationsController::class, 'selectlist'], ]); }); // Locations group - Route::resource('locations', 'LocationsController', + Route::resource('locations', Api\LocationsController::class, [ 'names' => [ 'index' => 'api.locations.index', @@ -527,11 +530,11 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::group(['prefix' => 'manufacturers'], function () { Route::get('selectlist', [ 'as' => 'manufacturers.selectlist', - 'uses' => 'ManufacturersController@selectlist', + 'uses' => [Api\ManufacturersController::class, 'selectlist'], ]); }); // Locations group - Route::resource('manufacturers', 'ManufacturersController', + Route::resource('manufacturers', Api\ManufacturersController::class, [ 'names' => [ 'index' => 'api.manufacturers.index', @@ -551,18 +554,18 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('assets', [ 'as' => 'api.models.assets', - 'uses'=> 'AssetModelsController@assets', + 'uses'=> [Api\AssetModelsController::class, 'assets'], ] ); Route::get('selectlist', [ 'as' => 'api.models.selectlist', - 'uses'=> 'AssetModelsController@selectlist', + 'uses'=> [Api\AssetModelsController::class, 'selectlist'], ] ); }); // Models group - Route::resource('models', 'AssetModelsController', + Route::resource('models', Api\AssetModelsController::class, [ 'names' => [ 'index' => 'api.models.index', @@ -579,38 +582,38 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' /*--- Settings API ---*/ Route::get('settings/ldaptest', [ 'as' => 'api.settings.ldaptest', - 'uses' => 'SettingsController@ldapAdSettingsTest', + 'uses' => [Api\SettingsController::class, 'ldapAdSettingsTest'], ]); Route::post('settings/purge_barcodes', [ 'as' => 'api.settings.purgebarcodes', - 'uses' => 'SettingsController@purgeBarcodes', + 'uses' => [Api\SettingsController::class, 'purgeBarcodes'], ]); Route::get('settings/login-attempts', [ 'middleware' => ['auth', 'authorize:superuser'], 'as' => 'api.settings.login_attempts', - 'uses' => 'SettingsController@showLoginAttempts', + 'uses' => [Api\SettingsController::class, 'showLoginAttempts'], ]); Route::post('settings/ldaptestlogin', [ 'as' => 'api.settings.ldaptestlogin', - 'uses' => 'SettingsController@ldaptestlogin', + 'uses' => [Api\SettingsController::class, 'ldaptestlogin'], ]); Route::post('settings/slacktest', [ 'as' => 'api.settings.slacktest', - 'uses' => 'SettingsController@slacktest', + 'uses' => [Api\SettingsController::class, 'slacktest'], ]); Route::post( 'settings/mailtest', [ 'as' => 'api.settings.mailtest', - 'uses' => 'SettingsController@ajaxTestEmail', + 'uses' => [Api\SettingsController::class, 'ajaxTestEmail'], ]); - Route::resource('settings', 'SettingsController', + Route::resource('settings', Api\SettingsController::class, [ 'names' => [ 'index' => 'api.settings.index', @@ -631,26 +634,26 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('assets', [ 'as' => 'api.statuslabels.assets.bytype', - 'uses' => 'StatuslabelsController@getAssetCountByStatuslabel', + 'uses' => [Api\StatuslabelsController::class, 'getAssetCountByStatuslabel'], ] ); Route::get('{statuslabel}/assetlist', [ 'as' => 'api.statuslabels.assets', - 'uses' => 'StatuslabelsController@assets', + 'uses' => [Api\StatuslabelsController::class, 'assets'], ] ); Route::get('{statuslabel}/deployable', [ 'as' => 'api.statuslabels.deployable', - 'uses' => 'StatuslabelsController@checkIfDeployable', + 'uses' => [Api\StatuslabelsController::class, 'checkIfDeployable'], ] ); }); - Route::resource('statuslabels', 'StatuslabelsController', + Route::resource('statuslabels', Api\StatuslabelsController::class, [ 'names' => [ 'index' => 'api.statuslabels.index', @@ -671,19 +674,19 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('list', [ 'as'=>'api.suppliers.list', - 'uses'=>'SuppliersController@getDatatable', + 'uses'=>[Api\SuppliersController::class, 'getDatatable'], ] ); Route::get('selectlist', [ 'as' => 'api.suppliers.selectlist', - 'uses' => 'SuppliersController@selectlist', + 'uses' => [Api\SuppliersController::class, 'selectlist'], ] ); }); // Suppliers group - Route::resource('suppliers', 'SuppliersController', + Route::resource('suppliers', Api\SuppliersController::class, [ 'names' => [ 'index' => 'api.suppliers.index', @@ -703,61 +706,61 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::post('two_factor_reset', [ 'as' => 'api.users.two_factor_reset', - 'uses' => 'UsersController@postTwoFactorReset', + 'uses' => [Api\UsersController::class, 'postTwoFactorReset'], ] ); Route::get('me', [ 'as' => 'api.users.me', - 'uses' => 'UsersController@getCurrentUserInfo', + 'uses' => [Api\UsersController::class, 'getCurrentUserInfo'], ] ); Route::get('list/{status?}', [ 'as' => 'api.users.list', - 'uses' => 'UsersController@getDatatable', + 'uses' => [Api\UsersController::class, 'getDatatable'], ] ); Route::get('selectlist', [ 'as' => 'api.users.selectlist', - 'uses' => 'UsersController@selectList', + 'uses' => [Api\UsersController::class, 'selectList'], ] ); Route::get('{user}/assets', [ 'as' => 'api.users.assetlist', - 'uses' => 'UsersController@assets', + 'uses' => [Api\UsersController::class, 'assets'], ] ); Route::get('{user}/accessories', [ 'as' => 'api.users.accessorieslist', - 'uses' => 'UsersController@accessories', + 'uses' => [Api\UsersController::class, 'accessories'], ] ); Route::get('{user}/licenses', [ 'as' => 'api.users.licenselist', - 'uses' => 'UsersController@licenses', + 'uses' => [Api\UsersController::class, 'licenses'], ] ); Route::post('{user}/upload', [ 'as' => 'api.users.uploads', - 'uses' => 'UsersController@postUpload', + 'uses' => [Api\UsersController::class, 'postUpload'], ] ); }); // Users group - Route::resource('users', 'UsersController', + Route::resource('users', Api\UsersController::class, [ 'names' => [ 'index' => 'api.users.index', @@ -773,12 +776,12 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get( 'reports/activity', - ['as' => 'api.activity.index', 'uses' => 'ReportsController@index'] + ['as' => 'api.activity.index', 'uses' => [Api\ReportsController::class, 'index']] ); /*--- Kits API ---*/ - Route::resource('kits', 'PredefinedKitsController', + Route::resource('kits', Api\PredefinedKitsController::class, [ 'names' => [ 'index' => 'api.kits.index', @@ -798,28 +801,28 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('licenses', [ 'as' => 'api.kits.licenses.index', - 'uses' => 'PredefinedKitsController@indexLicenses', + 'uses' => [Api\PredefinedKitsController::class, 'indexLicenses'], ] ); Route::post('licenses', [ 'as' => 'api.kits.licenses.store', - 'uses' => 'PredefinedKitsController@storeLicense', + 'uses' => [Api\PredefinedKitsController::class, 'storeLicense'], ] ); Route::put('licenses/{license_id}', [ 'as' => 'api.kits.licenses.update', - 'uses' => 'PredefinedKitsController@updateLicense', + 'uses' => [Api\PredefinedKitsController::class, 'updateLicense'], ] ); Route::delete('licenses/{license_id}', [ 'as' => 'api.kits.licenses.destroy', - 'uses' => 'PredefinedKitsController@detachLicense', + 'uses' => [Api\PredefinedKitsController::class, 'detachLicense'], ] ); @@ -827,28 +830,28 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('models', [ 'as' => 'api.kits.models.index', - 'uses' => 'PredefinedKitsController@indexModels', + 'uses' => [Api\PredefinedKitsController::class, 'indexModels'], ] ); Route::post('models', [ 'as' => 'api.kits.models.store', - 'uses' => 'PredefinedKitsController@storeModel', + 'uses' => [Api\PredefinedKitsController::class, 'storeModel'], ] ); Route::put('models/{model_id}', [ 'as' => 'api.kits.models.update', - 'uses' => 'PredefinedKitsController@updateModel', + 'uses' => [Api\PredefinedKitsController::class, 'updateModel'], ] ); Route::delete('models/{model_id}', [ 'as' => 'api.kits.models.destroy', - 'uses' => 'PredefinedKitsController@detachModel', + 'uses' => [Api\PredefinedKitsController::class, 'detachModel'], ] ); @@ -856,28 +859,28 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('accessories', [ 'as' => 'api.kits.accessories.index', - 'uses' => 'PredefinedKitsController@indexAccessories', + 'uses' => [Api\PredefinedKitsController::class, 'indexAccessories'], ] ); Route::post('accessories', [ 'as' => 'api.kits.accessories.store', - 'uses' => 'PredefinedKitsController@storeAccessory', + 'uses' => [Api\PredefinedKitsController::class, 'storeAccessory'], ] ); Route::put('accessories/{accessory_id}', [ 'as' => 'api.kits.accessories.update', - 'uses' => 'PredefinedKitsController@updateAccessory', + 'uses' => [Api\PredefinedKitsController::class, 'updateAccessory'], ] ); Route::delete('accessories/{accessory_id}', [ 'as' => 'api.kits.accessories.destroy', - 'uses' => 'PredefinedKitsController@detachAccessory', + 'uses' => [Api\PredefinedKitsController::class, 'detachAccessory'], ] ); @@ -885,28 +888,28 @@ Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'middleware' => 'auth:api' Route::get('consumables', [ 'as' => 'api.kits.consumables.index', - 'uses' => 'PredefinedKitsController@indexConsumables', + 'uses' => [Api\PredefinedKitsController::class, 'indexConsumables'], ] ); Route::post('consumables', [ 'as' => 'api.kits.consumables.store', - 'uses' => 'PredefinedKitsController@storeConsumable', + 'uses' => [Api\PredefinedKitsController::class, 'storeConsumable'], ] ); Route::put('consumables/{consumable_id}', [ 'as' => 'api.kits.consumables.update', - 'uses' => 'PredefinedKitsController@updateConsumable', + 'uses' => [Api\PredefinedKitsController::class, 'updateConsumable'], ] ); Route::delete('consumables/{consumable_id}', [ 'as' => 'api.kits.consumables.destroy', - 'uses' => 'PredefinedKitsController@detachConsumable', + 'uses' => [Api\PredefinedKitsController::class, 'detachConsumable'], ] ); }); // kits group diff --git a/routes/web.php b/routes/web.php index 0211c2bdd2..55a4f7b2d8 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,35 +1,57 @@ 'auth'], function () { /* * Companies */ - Route::resource('companies', 'CompaniesController', [ + Route::resource('companies', CompaniesController::class, [ 'parameters' => ['company' => 'company_id'], ]); /* * Categories */ - Route::resource('categories', 'CategoriesController', [ + Route::resource('categories', CategoriesController::class, [ 'parameters' => ['category' => 'category_id'], ]); /* * Locations */ - Route::resource('locations', 'LocationsController', [ + Route::resource('locations', LocationsController::class, [ 'parameters' => ['location' => 'location_id'], ]); Route::get( 'locations/{locationId}/printassigned', - ['as' => 'locations.print_assigned', 'uses' => 'LocationsController@print_assigned'] + ['as' => 'locations.print_assigned', 'uses' => [LocationsController::class, 'print_assigned']] ); Route::get( 'locations/{locationId}/printallassigned', - ['as' => 'locations.print_all_assigned', 'uses' => 'LocationsController@print_all_assigned'] + ['as' => 'locations.print_all_assigned', 'uses' => [LocationsController::class, 'print_all_assigned']] ); /* @@ -37,38 +59,38 @@ Route::group(['middleware' => 'auth'], function () { */ Route::group(['prefix' => 'manufacturers', 'middleware' => ['auth']], function () { - Route::get('{manufacturers_id}/restore', ['as' => 'restore/manufacturer', 'uses' => 'ManufacturersController@restore']); + Route::get('{manufacturers_id}/restore', ['as' => 'restore/manufacturer', 'uses' => [ManufacturersController::class, 'restore']]); }); - Route::resource('manufacturers', 'ManufacturersController', [ + Route::resource('manufacturers', ManufacturersController::class, [ 'parameters' => ['manufacturer' => 'manufacturers_id'], ]); /* * Suppliers */ - Route::resource('suppliers', 'SuppliersController', [ + Route::resource('suppliers', SuppliersController::class, [ 'parameters' => ['supplier' => 'supplier_id'], ]); /* * Depreciations */ - Route::resource('depreciations', 'DepreciationsController', [ + Route::resource('depreciations', DepreciationsController::class, [ 'parameters' => ['depreciation' => 'depreciation_id'], ]); /* * Status Labels */ - Route::resource('statuslabels', 'StatuslabelsController', [ + Route::resource('statuslabels', StatuslabelsController::class, [ 'parameters' => ['statuslabel' => 'statuslabel_id'], ]); /* * Departments */ - Route::resource('departments', 'DepartmentsController', [ + Route::resource('departments', DepartmentsController::class, [ 'parameters' => ['department' => 'department_id'], ]); }); @@ -84,7 +106,7 @@ Route::group(['middleware' => 'auth'], function () { */ Route::group(['middleware' => 'auth', 'prefix' => 'modals'], function () { - Route::get('{type}/{itemId?}', ['as' => 'modal.show', 'uses' => 'ModalController@show']); + Route::get('{type}/{itemId?}', ['as' => 'modal.show', 'uses' => [ModalController::class, 'show']]); }); /* @@ -101,7 +123,7 @@ Route::group(['middleware' => 'auth'], function () { 'display-sig/{filename}', [ 'as' => 'log.signature.view', - 'uses' => 'ActionlogController@displaySig', ] + 'uses' => [ActionlogController::class, 'displaySig'], ] ); }); @@ -115,71 +137,71 @@ Route::group(['middleware' => 'auth'], function () { */ Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'authorize:superuser']], function () { - Route::get('settings', ['as' => 'settings.general.index', 'uses' => 'SettingsController@getSettings']); - Route::post('settings', ['as' => 'settings.general.save', 'uses' => 'SettingsController@postSettings']); + Route::get('settings', ['as' => 'settings.general.index', 'uses' => [SettingsController::class, 'getSettings']]); + Route::post('settings', ['as' => 'settings.general.save', 'uses' => [SettingsController::class, 'postSettings']]); - Route::get('branding', ['as' => 'settings.branding.index', 'uses' => 'SettingsController@getBranding']); - Route::post('branding', ['as' => 'settings.branding.save', 'uses' => 'SettingsController@postBranding']); + Route::get('branding', ['as' => 'settings.branding.index', 'uses' => [SettingsController::class, 'getBranding']]); + Route::post('branding', ['as' => 'settings.branding.save', 'uses' => [SettingsController::class, 'postBranding']]); - Route::get('security', ['as' => 'settings.security.index', 'uses' => 'SettingsController@getSecurity']); - Route::post('security', ['as' => 'settings.security.save', 'uses' => 'SettingsController@postSecurity']); + Route::get('security', ['as' => 'settings.security.index', 'uses' => [SettingsController::class, 'getSecurity']]); + Route::post('security', ['as' => 'settings.security.save', 'uses' => [SettingsController::class, 'postSecurity']]); - Route::get('groups', ['as' => 'settings.groups.index', 'uses' => 'GroupsController@index']); + Route::get('groups', ['as' => 'settings.groups.index', 'uses' => [GroupsController::class, 'index']]); - Route::get('localization', ['as' => 'settings.localization.index', 'uses' => 'SettingsController@getLocalization']); - Route::post('localization', ['as' => 'settings.localization.save', 'uses' => 'SettingsController@postLocalization']); + Route::get('localization', ['as' => 'settings.localization.index', 'uses' => [SettingsController::class, 'getLocalization']]); + Route::post('localization', ['as' => 'settings.localization.save', 'uses' => [SettingsController::class, 'postLocalization']]); - Route::get('notifications', ['as' => 'settings.alerts.index', 'uses' => 'SettingsController@getAlerts']); - Route::post('notifications', ['as' => 'settings.alerts.save', 'uses' => 'SettingsController@postAlerts']); + Route::get('notifications', ['as' => 'settings.alerts.index', 'uses' => [SettingsController::class, 'getAlerts']]); + Route::post('notifications', ['as' => 'settings.alerts.save', 'uses' => [SettingsController::class, 'postAlerts']]); - Route::get('slack', ['as' => 'settings.slack.index', 'uses' => 'SettingsController@getSlack']); - Route::post('slack', ['as' => 'settings.slack.save', 'uses' => 'SettingsController@postSlack']); + Route::get('slack', ['as' => 'settings.slack.index', 'uses' => [SettingsController::class, 'getSlack']]); + Route::post('slack', ['as' => 'settings.slack.save', 'uses' => [SettingsController::class, 'postSlack']]); - Route::get('asset_tags', ['as' => 'settings.asset_tags.index', 'uses' => 'SettingsController@getAssetTags']); - Route::post('asset_tags', ['as' => 'settings.asset_tags.save', 'uses' => 'SettingsController@postAssetTags']); + Route::get('asset_tags', ['as' => 'settings.asset_tags.index', 'uses' => [SettingsController::class, 'getAssetTags']]); + Route::post('asset_tags', ['as' => 'settings.asset_tags.save', 'uses' => [SettingsController::class, 'postAssetTags']]); - Route::get('barcodes', ['as' => 'settings.barcodes.index', 'uses' => 'SettingsController@getBarcodes']); - Route::post('barcodes', ['as' => 'settings.barcodes.save', 'uses' => 'SettingsController@postBarcodes']); + Route::get('barcodes', ['as' => 'settings.barcodes.index', 'uses' => [SettingsController::class, 'getBarcodes']]); + Route::post('barcodes', ['as' => 'settings.barcodes.save', 'uses' => [SettingsController::class, 'postBarcodes']]); - Route::get('labels', ['as' => 'settings.labels.index', 'uses' => 'SettingsController@getLabels']); - Route::post('labels', ['as' => 'settings.labels.save', 'uses' => 'SettingsController@postLabels']); + Route::get('labels', ['as' => 'settings.labels.index', 'uses' => [SettingsController::class, 'getLabels']]); + Route::post('labels', ['as' => 'settings.labels.save', 'uses' => [SettingsController::class, 'postLabels']]); - Route::get('ldap', ['as' => 'settings.ldap.index', 'uses' => 'SettingsController@getLdapSettings']); - Route::post('ldap', ['as' => 'settings.ldap.save', 'uses' => 'SettingsController@postLdapSettings']); + Route::get('ldap', ['as' => 'settings.ldap.index', 'uses' => [SettingsController::class, 'getLdapSettings']]); + Route::post('ldap', ['as' => 'settings.ldap.save', 'uses' => [SettingsController::class, 'postLdapSettings']]); - Route::get('phpinfo', ['as' => 'settings.phpinfo.index', 'uses' => 'SettingsController@getPhpInfo']); + Route::get('phpinfo', ['as' => 'settings.phpinfo.index', 'uses' => [SettingsController::class, 'getPhpInfo']]); - Route::get('oauth', ['as' => 'settings.oauth.index', 'uses' => 'SettingsController@api']); + Route::get('oauth', ['as' => 'settings.oauth.index', 'uses' => [SettingsController::class, 'api']]); - Route::get('purge', ['as' => 'settings.purge.index', 'uses' => 'SettingsController@getPurge']); - Route::post('purge', ['as' => 'settings.purge.save', 'uses' => 'SettingsController@postPurge']); + Route::get('purge', ['as' => 'settings.purge.index', 'uses' => [SettingsController::class, 'getPurge']]); + Route::post('purge', ['as' => 'settings.purge.save', 'uses' => [SettingsController::class, 'postPurge']]); - Route::get('login-attempts', ['as' => 'settings.logins.index', 'uses' => 'SettingsController@getLoginAttempts']); + Route::get('login-attempts', ['as' => 'settings.logins.index', 'uses' => [SettingsController::class, 'getLoginAttempts']]); // Backups Route::group(['prefix' => 'backups', 'middleware' => 'auth'], function () { Route::get('download/{filename}', [ 'as' => 'settings.backups.download', - 'uses' => 'SettingsController@downloadFile', ]); + 'uses' => [SettingsController::class, 'downloadFile'], ]); Route::delete('delete/{filename}', [ 'as' => 'settings.backups.destroy', - 'uses' => 'SettingsController@deleteFile', ]); + 'uses' => [SettingsController::class, 'deleteFile'], ]); Route::post('/', [ 'as' => 'settings.backups.create', - 'uses' => 'SettingsController@postBackups', + 'uses' => [SettingsController::class, 'postBackups'], ]); - Route::get('/', ['as' => 'settings.backups.index', 'uses' => 'SettingsController@getBackups']); + Route::get('/', ['as' => 'settings.backups.index', 'uses' => [SettingsController::class, 'getBackups']]); }); - Route::resource('groups', 'GroupsController', [ + Route::resource('groups', GroupsController::class, [ 'middleware' => ['auth'], 'parameters' => ['group' => 'group_id'], ]); - Route::get('/', ['as' => 'settings.index', 'uses' => 'SettingsController@index']); + Route::get('/', ['as' => 'settings.index', 'uses' => [SettingsController::class, 'index']]); }); /* @@ -193,7 +215,7 @@ Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'authorize:superuser Route::group(['prefix' => 'import', 'middleware' => ['auth']], function () { Route::get('/', [ 'as' => 'imports.index', - 'uses' => 'ImportsController@index', + 'uses' => [ImportsController::class, 'index'], ]); }); @@ -208,116 +230,116 @@ Route::group(['prefix' => 'import', 'middleware' => ['auth']], function () { Route::group(['prefix' => 'account', 'middleware' => ['auth']], function () { // Profile - Route::get('profile', ['as' => 'profile', 'uses' => 'ProfileController@getIndex']); - Route::post('profile', 'ProfileController@postIndex'); + Route::get('profile', ['as' => 'profile', 'uses' => [ProfileController::class, 'getIndex']]); + Route::post('profile', [ProfileController::class, 'postIndex']); - Route::get('menu', ['as' => 'account.menuprefs', 'uses' => 'ProfileController@getMenuState']); + Route::get('menu', ['as' => 'account.menuprefs', 'uses' => [ProfileController::class, 'getMenuState']]); - Route::get('password', ['as' => 'account.password.index', 'uses' => 'ProfileController@password']); - Route::post('password', ['uses' => 'ProfileController@passwordSave']); + Route::get('password', ['as' => 'account.password.index', 'uses' => [ProfileController::class, 'password']]); + Route::post('password', ['uses' => [ProfileController::class, 'passwordSave']]); - Route::get('api', ['as' => 'user.api', 'uses' => 'ProfileController@api']); + Route::get('api', ['as' => 'user.api', 'uses' => [ProfileController::class, 'api']]); // View Assets - Route::get('view-assets', ['as' => 'view-assets', 'uses' => 'ViewAssetsController@getIndex']); + Route::get('view-assets', ['as' => 'view-assets', 'uses' => [ViewAssetsController::class, 'getIndex']]); - Route::get('requested', ['as' => 'account.requested', 'uses' => 'ViewAssetsController@getRequestedAssets']); + Route::get('requested', ['as' => 'account.requested', 'uses' => [ViewAssetsController::class, 'getRequestedAssets']]); // Accept Asset Route::get( 'accept-asset/{logID}', - ['as' => 'account/accept-assets', 'uses' => 'ViewAssetsController@getAcceptAsset'] + ['as' => 'account/accept-assets', 'uses' => [ViewAssetsController::class, 'getAcceptAsset']] ); // Profile Route::get( 'requestable-assets', - ['as' => 'requestable-assets', 'uses' => 'ViewAssetsController@getRequestableIndex'] + ['as' => 'requestable-assets', 'uses' => [ViewAssetsController::class, 'getRequestableIndex']] ); Route::get( 'request-asset/{assetId}', - ['as' => 'account/request-asset', 'uses' => 'ViewAssetsController@getRequestAsset'] + ['as' => 'account/request-asset', 'uses' => [ViewAssetsController::class, 'getRequestAsset']] ); Route::post( 'request/{itemType}/{itemId}', - ['as' => 'account/request-item', 'uses' => 'ViewAssetsController@getRequestItem'] + ['as' => 'account/request-item', 'uses' => [ViewAssetsController::class, 'getRequestItem']] ); // Account Dashboard - Route::get('/', ['as' => 'account', 'uses' => 'ViewAssetsController@getIndex']); + Route::get('/', ['as' => 'account', 'uses' => [ViewAssetsController::class, 'getIndex']]); - Route::get('accept', 'Account\AcceptanceController@index') + Route::get('accept', [Account\AcceptanceController::class, 'index']) ->name('account.accept'); - Route::get('accept/{id}', 'Account\AcceptanceController@create') + Route::get('accept/{id}', [Account\AcceptanceController::class, 'create']) ->name('account.accept.item'); - Route::post('accept/{id}', 'Account\AcceptanceController@store'); + Route::post('accept/{id}', [Account\AcceptanceController::class, 'store']); }); Route::group(['middleware' => ['auth']], function () { Route::get('reports/audit', [ 'as' => 'reports.audit', - 'uses' => 'ReportsController@audit', + 'uses' => [ReportsController::class, 'audit'], ]); Route::get( 'reports/depreciation', - ['as' => 'reports/depreciation', 'uses' => 'ReportsController@getDeprecationReport'] + ['as' => 'reports/depreciation', 'uses' => [ReportsController::class, 'getDeprecationReport']] ); Route::get( 'reports/export/depreciation', - ['as' => 'reports/export/depreciation', 'uses' => 'ReportsController@exportDeprecationReport'] + ['as' => 'reports/export/depreciation', 'uses' => [ReportsController::class, 'exportDeprecationReport']] ); Route::get( 'reports/asset_maintenances', - ['as' => 'reports/asset_maintenances', 'uses' => 'ReportsController@getAssetMaintenancesReport'] + ['as' => 'reports/asset_maintenances', 'uses' => [ReportsController::class, 'getAssetMaintenancesReport']] ); Route::get( 'reports/export/asset_maintenances', [ 'as' => 'reports/export/asset_maintenances', - 'uses' => 'ReportsController@exportAssetMaintenancesReport', + 'uses' => [ReportsController::class, 'exportAssetMaintenancesReport'], ] ); Route::get( 'reports/licenses', - ['as' => 'reports/licenses', 'uses' => 'ReportsController@getLicenseReport'] + ['as' => 'reports/licenses', 'uses' => [ReportsController::class, 'getLicenseReport']] ); Route::get( 'reports/export/licenses', - ['as' => 'reports/export/licenses', 'uses' => 'ReportsController@exportLicenseReport'] + ['as' => 'reports/export/licenses', 'uses' => [ReportsController::class, 'exportLicenseReport']] ); - Route::get('reports/accessories', ['as' => 'reports/accessories', 'uses' => 'ReportsController@getAccessoryReport']); + Route::get('reports/accessories', ['as' => 'reports/accessories', 'uses' => [ReportsController::class, 'getAccessoryReport']]); Route::get( 'reports/export/accessories', - ['as' => 'reports/export/accessories', 'uses' => 'ReportsController@exportAccessoryReport'] + ['as' => 'reports/export/accessories', 'uses' => [ReportsController::class, 'exportAccessoryReport']] ); - Route::get('reports/custom', ['as' => 'reports/custom', 'uses' => 'ReportsController@getCustomReport']); - Route::post('reports/custom', 'ReportsController@postCustom'); + Route::get('reports/custom', ['as' => 'reports/custom', 'uses' => [ReportsController::class, 'getCustomReport']]); + Route::post('reports/custom', [ReportsController::class, 'postCustom']); Route::get( 'reports/activity', - ['as' => 'reports.activity', 'uses' => 'ReportsController@getActivityReport'] + ['as' => 'reports.activity', 'uses' => [ReportsController::class, 'getActivityReport']] ); - Route::post('reports/activity', 'ReportsController@postActivityReport'); + Route::post('reports/activity', [ReportsController::class, 'postActivityReport']); Route::get( 'reports/unaccepted_assets', - ['as' => 'reports/unaccepted_assets', 'uses' => 'ReportsController@getAssetAcceptanceReport'] + ['as' => 'reports/unaccepted_assets', 'uses' => [ReportsController::class, 'getAssetAcceptanceReport']] ); Route::get( 'reports/export/unaccepted_assets', - ['as' => 'reports/export/unaccepted_assets', 'uses' => 'ReportsController@exportAssetAcceptanceReport'] + ['as' => 'reports/export/unaccepted_assets', 'uses' => [ReportsController::class, 'exportAssetAcceptanceReport']] ); }); Route::get( 'auth/signin', - ['uses' => 'Auth\LoginController@legacyAuthRedirect'] + ['uses' => [Auth\LoginController::class, 'legacyAuthRedirect']] ); /* @@ -333,42 +355,42 @@ Route::group(['prefix' => 'setup', 'middleware' => 'web'], function () { 'user', [ 'as' => 'setup.user', - 'uses' => 'SettingsController@getSetupUser', ] + 'uses' => [SettingsController::class, 'getSetupUser'], ] ); Route::post( 'user', [ 'as' => 'setup.user.save', - 'uses' => 'SettingsController@postSaveFirstAdmin', ] + 'uses' => [SettingsController::class, 'postSaveFirstAdmin'], ] ); Route::get( 'migrate', [ 'as' => 'setup.migrate', - 'uses' => 'SettingsController@getSetupMigrate', ] + 'uses' => [SettingsController::class, 'getSetupMigrate'], ] ); Route::get( 'done', [ 'as' => 'setup.done', - 'uses' => 'SettingsController@getSetupDone', ] + 'uses' => [SettingsController::class, 'getSetupDone'], ] ); Route::get( 'mailtest', [ 'as' => 'setup.mailtest', - 'uses' => 'SettingsController@ajaxTestEmail', ] + 'uses' => [SettingsController::class, 'ajaxTestEmail'], ] ); Route::get( '/', [ 'as' => 'setup', - 'uses' => 'SettingsController@getSetupIndex', ] + 'uses' => [SettingsController::class, 'getSetupIndex'], ] ); }); @@ -377,7 +399,7 @@ Route::get( [ 'as' => 'two-factor-enroll', 'middleware' => ['web'], - 'uses' => 'Auth\LoginController@getTwoFactorEnroll', ] + 'uses' => [Auth\LoginController::class, 'getTwoFactorEnroll'], ] ); Route::get( @@ -385,7 +407,7 @@ Route::get( [ 'as' => 'two-factor', 'middleware' => ['web'], - 'uses' => 'Auth\LoginController@getTwoFactorAuth', ] + 'uses' => [Auth\LoginController::class, 'getTwoFactorAuth'], ] ); Route::post( @@ -393,7 +415,7 @@ Route::post( [ 'as' => 'two-factor', 'middleware' => ['web'], - 'uses' => 'Auth\LoginController@postTwoFactorAuth', ] + 'uses' => [Auth\LoginController::class, 'postTwoFactorAuth'], ] ); Route::get( @@ -401,7 +423,7 @@ Route::get( [ 'as' => 'home', 'middleware' => ['auth'], - 'uses' => 'DashboardController@getIndex', ] + 'uses' => [DashboardController::class, 'getIndex'], ] ); Route::group(['middleware' => 'web'], function () { @@ -411,7 +433,7 @@ Route::group(['middleware' => 'web'], function () { [ 'as' => 'login', 'middleware' => ['web'], - 'uses' => 'Auth\LoginController@showLoginForm', ] + 'uses' => [Auth\LoginController::class, 'showLoginForm'], ] ); Route::post( @@ -419,17 +441,17 @@ Route::group(['middleware' => 'web'], function () { [ 'as' => 'login', 'middleware' => ['web'], - 'uses' => 'Auth\LoginController@login', ] + 'uses' => [Auth\LoginController::class, 'login'], ] ); Route::get( 'logout', [ 'as' => 'logout', - 'uses' => 'Auth\LoginController@logout', ] + 'uses' => [Auth\LoginController::class, 'logout'], ] ); }); Auth::routes(); -Route::get('/health', ['as' => 'health', 'uses' => 'HealthController@get']); +Route::get('/health', ['as' => 'health', 'uses' => [HealthController::class, 'get']]); diff --git a/routes/web/accessories.php b/routes/web/accessories.php index 5db8490f54..52b282ead8 100644 --- a/routes/web/accessories.php +++ b/routes/web/accessories.php @@ -1,29 +1,32 @@ 'accessories', 'middleware' => ['auth']], function () { Route::get( '{accessoryID}/checkout', - ['as' => 'checkout/accessory', 'uses' => 'Accessories\AccessoryCheckoutController@create'] + ['as' => 'checkout/accessory', 'uses' => [Accessories\AccessoryCheckoutController::class, 'create']] ); Route::post( '{accessoryID}/checkout', - ['as' => 'checkout/accessory', 'uses' => 'Accessories\AccessoryCheckoutController@store'] + ['as' => 'checkout/accessory', 'uses' => [Accessories\AccessoryCheckoutController::class, 'store']] ); Route::get( '{accessoryID}/checkin/{backto?}', - ['as' => 'checkin/accessory', 'uses' => 'Accessories\AccessoryCheckinController@create'] + ['as' => 'checkin/accessory', 'uses' => [Accessories\AccessoryCheckinController::class, 'create']] ); Route::post( '{accessoryID}/checkin/{backto?}', - ['as' => 'checkin/accessory', 'uses' => 'Accessories\AccessoryCheckinController@store'] + ['as' => 'checkin/accessory', 'uses' => [Accessories\AccessoryCheckinController::class, 'store']] ); }); -Route::resource('accessories', 'Accessories\AccessoriesController', [ +Route::resource('accessories', Accessories\AccessoriesController::class, [ 'middleware' => ['auth'], 'parameters' => ['accessory' => 'accessory_id'], ]); diff --git a/routes/web/components.php b/routes/web/components.php index f884a3b4ac..7b37cc9eab 100644 --- a/routes/web/components.php +++ b/routes/web/components.php @@ -1,26 +1,29 @@ 'components', 'middleware' => ['auth']], function () { Route::get( '{componentID}/checkout', - ['as' => 'checkout/component', 'uses' => 'Components\ComponentCheckoutController@create'] + ['as' => 'checkout/component', 'uses' => [Components\ComponentCheckoutController::class, 'create']] ); Route::post( '{componentID}/checkout', - ['as' => 'checkout/component', 'uses' => 'Components\ComponentCheckoutController@store'] + ['as' => 'checkout/component', 'uses' => [Components\ComponentCheckoutController::class, 'store']] ); Route::get( '{componentID}/checkin', - ['as' => 'checkin/component', 'uses' => 'Components\ComponentCheckinController@create'] + ['as' => 'checkin/component', 'uses' => [Components\ComponentCheckinController::class, 'create']] ); Route::post( '{componentID}/checkin', - ['as' => 'component.checkin.save', 'uses' => 'Components\ComponentCheckinController@store'] + ['as' => 'component.checkin.save', 'uses' => [Components\ComponentCheckinController::class, 'store']] ); }); -Route::resource('components', 'Components\ComponentsController', [ +Route::resource('components', Components\ComponentsController::class, [ 'middleware' => ['auth'], 'parameters' => ['component' => 'component_id'], ]); diff --git a/routes/web/consumables.php b/routes/web/consumables.php index a51710e528..9caf442e4b 100644 --- a/routes/web/consumables.php +++ b/routes/web/consumables.php @@ -1,18 +1,21 @@ 'consumables', 'middleware' => ['auth']], function () { Route::get( '{consumableID}/checkout', - ['as' => 'checkout/consumable', 'uses' => 'Consumables\ConsumableCheckoutController@create'] + ['as' => 'checkout/consumable', 'uses' => [Consumables\ConsumableCheckoutController::class, 'create']] ); Route::post( '{consumableID}/checkout', - ['as' => 'checkout/consumable', 'uses' => 'Consumables\ConsumableCheckoutController@store'] + ['as' => 'checkout/consumable', 'uses' => [Consumables\ConsumableCheckoutController::class, 'store']] ); }); - Route::resource('consumables', 'Consumables\ConsumablesController', [ + Route::resource('consumables', Consumables\ConsumablesController::class, [ 'middleware' => ['auth'], 'parameters' => ['consumable' => 'consumable_id'], ]); diff --git a/routes/web/fields.php b/routes/web/fields.php index 091245921e..c1b82d45b9 100644 --- a/routes/web/fields.php +++ b/routes/web/fields.php @@ -1,35 +1,39 @@ 'fields', 'middleware' => ['auth']], function () { Route::get('required/{fieldset_id}/{field_id}', - ['uses' => 'CustomFieldsetsController@makeFieldRequired', + ['uses' => [CustomFieldsetsController::class, 'makeFieldRequired'], 'as' => 'fields.required', ] ); Route::get('optional/{fieldset_id}/{field_id}', - ['uses' => 'CustomFieldsetsController@makeFieldOptional', + ['uses' => [CustomFieldsetsController::class, 'makeFieldOptional'], 'as' => 'fields.optional', ] ); Route::get('{field_id}/fieldset/{fieldset_id}/disassociate', - ['uses' => 'CustomFieldsController@deleteFieldFromFieldset', + ['uses' => [CustomFieldsController::class, 'deleteFieldFromFieldset'], 'as' => 'fields.disassociate', ] ); Route::post('fieldsets/{id}/associate', - ['uses' => 'CustomFieldsetsController@associate', + ['uses' => [CustomFieldsetsController::class, 'associate'], 'as' => 'fieldsets.associate', ] ); - Route::resource('fieldsets', 'CustomFieldsetsController', [ + Route::resource('fieldsets', CustomFieldsetsController::class, [ 'parameters' => ['fieldset' => 'field_id', 'field' => 'field_id'], ]); }); -Route::resource('fields', 'CustomFieldsController', [ +Route::resource('fields', CustomFieldsController::class, [ 'middleware' => ['auth'], 'parameters' => ['field' => 'field_id', 'fieldset' => 'fieldset_id'], ]); diff --git a/routes/web/hardware.php b/routes/web/hardware.php index bd0302a2ea..095510a763 100644 --- a/routes/web/hardware.php +++ b/routes/web/hardware.php @@ -1,4 +1,8 @@ 'assets.bulkaudit', - 'uses' => 'Assets\AssetsController@quickScan', + 'uses' => [Assets\AssetsController::class, 'quickScan'], ]); // Asset Maintenances - Route::resource('maintenances', 'AssetMaintenancesController', [ + Route::resource('maintenances', AssetMaintenancesController::class, [ 'parameters' => ['maintenance' => 'maintenance_id', 'asset' => 'asset_id'], ]); - Route::get('requested', ['as' => 'assets.requested', 'uses' => 'Assets\AssetsController@getRequestedIndex']); + Route::get('requested', ['as' => 'assets.requested', 'uses' => [Assets\AssetsController::class, 'getRequestedIndex']]); Route::get('scan', [ 'as' => 'asset.scan', - 'uses' => 'Assets\AssetsController@scan', + 'uses' => [Assets\AssetsController::class, 'scan'], ]); Route::get('audit/due', [ 'as' => 'assets.audit.due', - 'uses' => 'Assets\AssetsController@dueForAudit', + 'uses' => [Assets\AssetsController::class, 'dueForAudit'], ]); Route::get('audit/overdue', [ 'as' => 'assets.audit.overdue', - 'uses' => 'Assets\AssetsController@overdueForAudit', + 'uses' => [Assets\AssetsController::class, 'overdueForAudit'], ]); Route::get('audit/due', [ 'as' => 'assets.audit.due', - 'uses' => 'Assets\AssetsController@dueForAudit', + 'uses' => [Assets\AssetsController::class, 'dueForAudit'], ]); Route::get('audit/overdue', [ 'as' => 'assets.audit.overdue', - 'uses' => 'Assets\AssetsController@overdueForAudit', + 'uses' => [Assets\AssetsController::class, 'overdueForAudit'], ]); Route::get('audit/due', [ 'as' => 'assets.audit.due', - 'uses' => 'Assets\AssetsController@dueForAudit', + 'uses' => [Assets\AssetsController::class, 'dueForAudit'], ]); Route::get('audit/overdue', [ 'as' => 'assets.audit.overdue', - 'uses' => 'Assets\AssetsController@overdueForAudit', + 'uses' => [Assets\AssetsController::class, 'overdueForAudit'], ]); Route::get('audit/{id}', [ 'as' => 'asset.audit.create', - 'uses' => 'Assets\AssetsController@audit', + 'uses' => [Assets\AssetsController::class, 'audit'], ]); Route::post('audit/{id}', [ 'as' => 'asset.audit.store', - 'uses' => 'Assets\AssetsController@auditStore', + 'uses' => [Assets\AssetsController::class, 'auditStore'], ]); Route::get('history', [ 'as' => 'asset.import-history', - 'uses' => 'Assets\AssetsController@getImportHistory', + 'uses' => [Assets\AssetsController::class, 'getImportHistory'], ]); Route::post('history', [ 'as' => 'asset.process-import-history', - 'uses' => 'Assets\AssetsController@postImportHistory', + 'uses' => [Assets\AssetsController::class, 'postImportHistory'], ]); Route::get('bytag/{any?}', [ 'as' => 'findbytag/hardware', - 'uses' => 'Assets\AssetsController@getAssetByTag', + 'uses' => [Assets\AssetsController::class, 'getAssetByTag'], ] )->where('any', '.*'); Route::get('byserial/{any?}', [ 'as' => 'findbyserial/hardware', - 'uses' => 'Assets\AssetsController@getAssetBySerial', + 'uses' => [Assets\AssetsController::class, 'getAssetBySerial'], ] )->where('any', '.*'); Route::get('{assetId}/clone', [ 'as' => 'clone/hardware', - 'uses' => 'Assets\AssetsController@getClone', + 'uses' => [Assets\AssetsController::class, 'getClone'], ]); Route::get('{assetId}/label', [ 'as' => 'label/hardware', - 'uses' => 'Assets\AssetsController@getLabel', + 'uses' => [Assets\AssetsController::class, 'getLabel'], ]); - Route::post('{assetId}/clone', 'Assets\AssetsController@postCreate'); + Route::post('{assetId}/clone', [Assets\AssetsController::class, 'postCreate']); Route::get('{assetId}/checkout', [ 'as' => 'checkout/hardware', - 'uses' => 'Assets\AssetCheckoutController@create', + 'uses' => [Assets\AssetCheckoutController::class, 'create'], ]); Route::post('{assetId}/checkout', [ 'as' => 'checkout/hardware', - 'uses' => 'Assets\AssetCheckoutController@store', + 'uses' => [Assets\AssetCheckoutController::class, 'store'], ]); Route::get('{assetId}/checkin/{backto?}', [ 'as' => 'checkin/hardware', - 'uses' => 'Assets\AssetCheckinController@create', + 'uses' => [Assets\AssetCheckinController::class, 'create'], ]); Route::post('{assetId}/checkin/{backto?}', [ 'as' => 'checkin/hardware', - 'uses' => 'Assets\AssetCheckinController@store', + 'uses' => [Assets\AssetCheckinController::class, 'store'], ]); Route::get('{assetId}/view', [ 'as' => 'hardware.view', - 'uses' => 'Assets\AssetsController@show', + 'uses' => [Assets\AssetsController::class, 'show'], ]); - Route::get('{assetId}/qr_code', ['as' => 'qr_code/hardware', 'uses' => 'Assets\AssetsController@getQrCode']); - Route::get('{assetId}/barcode', ['as' => 'barcode/hardware', 'uses' => 'Assets\AssetsController@getBarCode']); + Route::get('{assetId}/qr_code', ['as' => 'qr_code/hardware', 'uses' => [Assets\AssetsController::class, 'getQrCode']]); + Route::get('{assetId}/barcode', ['as' => 'barcode/hardware', 'uses' => [Assets\AssetsController::class, 'getBarCode']]); Route::get('{assetId}/restore', [ 'as' => 'restore/hardware', - 'uses' => 'Assets\AssetsController@getRestore', + 'uses' => [Assets\AssetsController::class, 'getRestore'], ]); Route::post('{assetId}/upload', [ 'as' => 'upload/asset', - 'uses' => 'Assets\AssetFilesController@store', + 'uses' => [Assets\AssetFilesController::class, 'store'], ]); Route::get('{assetId}/showfile/{fileId}/{download?}', [ 'as' => 'show/assetfile', - 'uses' => 'Assets\AssetFilesController@show', + 'uses' => [Assets\AssetFilesController::class, 'show'], ]); Route::delete('{assetId}/showfile/{fileId}/delete', [ 'as' => 'delete/assetfile', - 'uses' => 'Assets\AssetFilesController@destroy', + 'uses' => [Assets\AssetFilesController::class, 'destroy'], ]); Route::post( 'bulkedit', [ 'as' => 'hardware/bulkedit', - 'uses' => 'Assets\BulkAssetsController@edit', + 'uses' => [Assets\BulkAssetsController::class, 'edit'], ] ); Route::post( 'bulkdelete', [ 'as' => 'hardware/bulkdelete', - 'uses' => 'Assets\BulkAssetsController@destroy', + 'uses' => [Assets\BulkAssetsController::class, 'destroy'], ] ); Route::post( 'bulksave', [ 'as' => 'hardware/bulksave', - 'uses' => 'Assets\BulkAssetsController@update', + 'uses' => [Assets\BulkAssetsController::class, 'update'], ] ); // Bulk checkout / checkin Route::get('bulkcheckout', [ 'as' => 'hardware/bulkcheckout', - 'uses' => 'Assets\BulkAssetsController@showCheckout', + 'uses' => [Assets\BulkAssetsController::class, 'showCheckout'], ]); Route::post('bulkcheckout', [ 'as' => 'hardware/bulkcheckout', - 'uses' => 'Assets\BulkAssetsController@storeCheckout', + 'uses' => [Assets\BulkAssetsController::class, 'storeCheckout'], ]); }); -Route::resource('hardware', 'Assets\AssetsController', [ +Route::resource('hardware', Assets\AssetsController::class, [ 'middleware' => ['auth'], 'parameters' => ['asset' => 'asset_id'], ]); diff --git a/routes/web/kits.php b/routes/web/kits.php index a73392d26a..53f3d29ae5 100644 --- a/routes/web/kits.php +++ b/routes/web/kits.php @@ -1,7 +1,10 @@ ['auth'], 'parameters' => ['kit' => 'kit_id'], ]); @@ -11,28 +14,28 @@ Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function ( // Route::get('licenses', // [ // 'as' => 'kits.licenses.index', - // 'uses' => 'Kits\PredefinedKitsController@indexLicenses', + // 'uses' => [Kits\PredefinedKitsController::class, 'indexLicenses'], // ] // ); Route::post('licenses', [ 'as' => 'kits.licenses.store', - 'uses' => 'Kits\PredefinedKitsController@storeLicense', + 'uses' => [Kits\PredefinedKitsController::class, 'storeLicense'], ] ); Route::put('licenses/{license_id}', [ 'as' => 'kits.licenses.update', - 'uses' => 'Kits\PredefinedKitsController@updateLicense', + 'uses' => [Kits\PredefinedKitsController::class, 'updateLicense'], ] ); Route::get('licenses/{license_id}/edit', [ 'as' => 'kits.licenses.edit', - 'uses' => 'Kits\PredefinedKitsController@editLicense', + 'uses' => [Kits\PredefinedKitsController::class, 'editLicense'], ] ); @@ -40,7 +43,7 @@ Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function ( Route::delete('licenses/{license_id}', [ 'as' => 'kits.licenses.detach', - 'uses' => 'Kits\PredefinedKitsController@detachLicense', + 'uses' => [Kits\PredefinedKitsController::class, 'detachLicense'], ] ); @@ -49,7 +52,7 @@ Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function ( Route::put('models/{model_id}', [ 'as' => 'kits.models.update', - 'uses' => 'Kits\PredefinedKitsController@updateModel', + 'uses' => [Kits\PredefinedKitsController::class, 'updateModel'], 'parameters' => [2 => 'kit_id', 1 => 'model_id'], ] ); @@ -57,7 +60,7 @@ Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function ( Route::get('models/{model_id}/edit', [ 'as' => 'kits.models.edit', - 'uses' => 'Kits\PredefinedKitsController@editModel', + 'uses' => [Kits\PredefinedKitsController::class, 'editModel'], ] ); @@ -65,7 +68,7 @@ Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function ( Route::delete('models/{model_id}', [ 'as' => 'kits.models.detach', - 'uses' => 'Kits\PredefinedKitsController@detachModel', + 'uses' => [Kits\PredefinedKitsController::class, 'detachModel'], ] ); @@ -73,7 +76,7 @@ Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function ( Route::put('consumables/{consumable_id}', [ 'as' => 'kits.consumables.update', - 'uses' => 'Kits\PredefinedKitsController@updateConsumable', + 'uses' => [Kits\PredefinedKitsController::class, 'updateConsumable'], 'parameters' => [2 => 'kit_id', 1 => 'consumable_id'], ] ); @@ -81,7 +84,7 @@ Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function ( Route::get('consumables/{consumable_id}/edit', [ 'as' => 'kits.consumables.edit', - 'uses' => 'Kits\PredefinedKitsController@editConsumable', + 'uses' => [Kits\PredefinedKitsController::class, 'editConsumable'], ] ); @@ -89,7 +92,7 @@ Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function ( Route::delete('consumables/{consumable_id}', [ 'as' => 'kits.consumables.detach', - 'uses' => 'Kits\PredefinedKitsController@detachConsumable', + 'uses' => [Kits\PredefinedKitsController::class, 'detachConsumable'], ] ); @@ -97,7 +100,7 @@ Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function ( Route::put('accessories/{accessory_id}', [ 'as' => 'kits.accessories.update', - 'uses' => 'Kits\PredefinedKitsController@updateAccessory', + 'uses' => [Kits\PredefinedKitsController::class, 'updateAccessory'], 'parameters' => [2 => 'kit_id', 1 => 'accessory_id'], ] ); @@ -105,7 +108,7 @@ Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function ( Route::get('accessories/{accessory_id}/edit', [ 'as' => 'kits.accessories.edit', - 'uses' => 'Kits\PredefinedKitsController@editAccessory', + 'uses' => [Kits\PredefinedKitsController::class, 'editAccessory'], ] ); @@ -113,20 +116,20 @@ Route::group(['prefix' => 'kits/{kit_id}', 'middleware' => ['auth']], function ( Route::delete('accessories/{accessory_id}', [ 'as' => 'kits.accessories.detach', - 'uses' => 'Kits\PredefinedKitsController@detachAccessory', + 'uses' => [Kits\PredefinedKitsController::class, 'detachAccessory'], ] ); Route::get('checkout', [ 'as' => 'kits.checkout.show', - 'uses' => 'Kits\CheckoutKitController@showCheckout', + 'uses' => [Kits\CheckoutKitController::class, 'showCheckout'], ] ); Route::post('checkout', [ 'as' => 'kits.checkout.store', - 'uses' => 'Kits\CheckoutKitController@store', + 'uses' => [Kits\CheckoutKitController::class, 'store'], ] ); }); // kits diff --git a/routes/web/licenses.php b/routes/web/licenses.php index 4c3b01d955..a7a03b710f 100644 --- a/routes/web/licenses.php +++ b/routes/web/licenses.php @@ -1,46 +1,49 @@ 'licenses', 'middleware' => ['auth']], function () { - Route::get('{licenseId}/clone', ['as' => 'clone/license', 'uses' => 'Licenses\LicensesController@getClone']); + Route::get('{licenseId}/clone', ['as' => 'clone/license', 'uses' => [Licenses\LicensesController::class, 'getClone']]); Route::get('{licenseId}/freecheckout', [ 'as' => 'licenses.freecheckout', - 'uses' => 'Licenses\LicensesController@getFreeLicense', + 'uses' => [Licenses\LicensesController::class, 'getFreeLicense'], ]); Route::get('{licenseId}/checkout/{seatId?}', [ 'as' => 'licenses.checkout', - 'uses' => 'Licenses\LicenseCheckoutController@create', + 'uses' => [Licenses\LicenseCheckoutController::class, 'create'], ]); Route::post( '{licenseId}/checkout/{seatId?}', - ['as' => 'licenses.checkout', 'uses' => 'Licenses\LicenseCheckoutController@store'] + ['as' => 'licenses.checkout', 'uses' => [Licenses\LicenseCheckoutController::class, 'store']] ); Route::get('{licenseSeatId}/checkin/{backto?}', [ 'as' => 'licenses.checkin', - 'uses' => 'Licenses\LicenseCheckinController@create', + 'uses' => [Licenses\LicenseCheckinController::class, 'create'], ]); Route::post('{licenseId}/checkin/{backto?}', [ 'as' => 'licenses.checkin.save', - 'uses' => 'Licenses\LicenseCheckinController@store', + 'uses' => [Licenses\LicenseCheckinController::class, 'store'], ]); Route::post( '{licenseId}/upload', - ['as' => 'upload/license', 'uses' => 'Licenses\LicenseFilesController@store'] + ['as' => 'upload/license', 'uses' => [Licenses\LicenseFilesController::class, 'store']] ); Route::delete( '{licenseId}/deletefile/{fileId}', - ['as' => 'delete/licensefile', 'uses' => 'Licenses\LicenseFilesController@destroy'] + ['as' => 'delete/licensefile', 'uses' => [Licenses\LicenseFilesController::class, 'destroy']] ); Route::get( '{licenseId}/showfile/{fileId}/{download?}', - ['as' => 'show.licensefile', 'uses' => 'Licenses\LicenseFilesController@show'] + ['as' => 'show.licensefile', 'uses' => [Licenses\LicenseFilesController::class, 'show']] ); }); -Route::resource('licenses', 'Licenses\LicensesController', [ +Route::resource('licenses', Licenses\LicensesController::class, [ 'middleware' => ['auth'], 'parameters' => ['license' => 'license_id'], ]); diff --git a/routes/web/models.php b/routes/web/models.php index b9d861ab4c..fff7b67447 100644 --- a/routes/web/models.php +++ b/routes/web/models.php @@ -1,18 +1,22 @@ 'models', 'middleware' => ['auth']], function () { - Route::get('{modelId}/clone', ['as' => 'clone/model', 'uses' => 'AssetModelsController@getClone']); - Route::post('{modelId}/clone', 'AssetModelsController@postCreate'); - Route::get('{modelId}/view', ['as' => 'view/model', 'uses' => 'AssetModelsController@getView']); - Route::get('{modelID}/restore', ['as' => 'restore/model', 'uses' => 'AssetModelsController@getRestore', 'middleware' => ['authorize:superuser']]); - Route::get('{modelId}/custom_fields', ['as' => 'custom_fields/model', 'uses' => 'AssetModelsController@getCustomFields']); - Route::post('bulkedit', ['as' => 'models.bulkedit.index', 'uses' => 'BulkAssetModelsController@edit']); - Route::post('bulksave', ['as' => 'models.bulkedit.store', 'uses' => 'BulkAssetModelsController@update']); - Route::post('bulkdelete', ['as' => 'models.bulkdelete.store', 'uses' => 'BulkAssetModelsController@destroy']); + Route::get('{modelId}/clone', ['as' => 'clone/model', 'uses' => [AssetModelsController::class, 'getClone']]); + Route::post('{modelId}/clone', [AssetModelsController::class, 'postCreate']); + Route::get('{modelId}/view', ['as' => 'view/model', 'uses' => [AssetModelsController::class, 'getView']]); + Route::get('{modelID}/restore', ['as' => 'restore/model', 'uses' => [AssetModelsController::class, 'getRestore'], 'middleware' => ['authorize:superuser']]); + Route::get('{modelId}/custom_fields', ['as' => 'custom_fields/model', 'uses' => [AssetModelsController::class, 'getCustomFields']]); + Route::post('bulkedit', ['as' => 'models.bulkedit.index', 'uses' => [BulkAssetModelsController::class, 'edit']]); + Route::post('bulksave', ['as' => 'models.bulkedit.store', 'uses' => [BulkAssetModelsController::class, 'update']]); + Route::post('bulkdelete', ['as' => 'models.bulkdelete.store', 'uses' => [BulkAssetModelsController::class, 'destroy']]); }); -Route::resource('models', 'AssetModelsController', [ +Route::resource('models', AssetModelsController::class, [ 'middleware' => ['auth'], 'parameters' => ['model' => 'model_id'], ]); diff --git a/routes/web/users.php b/routes/web/users.php index 0856788a44..613aa348a4 100644 --- a/routes/web/users.php +++ b/routes/web/users.php @@ -1,62 +1,65 @@ 'users', 'middleware' => ['auth']], function () { - Route::get('ldap', ['as' => 'ldap/user', 'uses' => 'Users\LDAPImportController@create']); - Route::post('ldap', 'Users\LDAPImportController@store'); - Route::get('export', ['as' => 'users.export', 'uses' => 'Users\UsersController@getExportUserCsv']); - Route::get('{userId}/clone', ['as' => 'clone/user', 'uses' => 'Users\UsersController@getClone']); - Route::post('{userId}/clone', ['uses' => 'Users\UsersController@postCreate']); - Route::get('{userId}/restore', ['as' => 'restore/user', 'uses' => 'Users\UsersController@getRestore']); - Route::get('{userId}/unsuspend', ['as' => 'unsuspend/user', 'uses' => 'Users\UsersController@getUnsuspend']); - Route::post('{userId}/upload', ['as' => 'upload/user', 'uses' => 'Users\UserFilesController@store']); + Route::get('ldap', ['as' => 'ldap/user', 'uses' => [Users\LDAPImportController::class, 'create']]); + Route::post('ldap', [Users\LDAPImportController::class, 'store']); + Route::get('export', ['as' => 'users.export', 'uses' => [Users\UsersController::class, 'getExportUserCsv']]); + Route::get('{userId}/clone', ['as' => 'clone/user', 'uses' => [Users\UsersController::class, 'getClone']]); + Route::post('{userId}/clone', ['uses' => [Users\UsersController::class, 'postCreate']]); + Route::get('{userId}/restore', ['as' => 'restore/user', 'uses' => [Users\UsersController::class, 'getRestore']]); + Route::get('{userId}/unsuspend', ['as' => 'unsuspend/user', 'uses' => [Users\UsersController::class, 'getUnsuspend']]); + Route::post('{userId}/upload', ['as' => 'upload/user', 'uses' => [Users\UserFilesController::class, 'store']]); Route::delete( '{userId}/deletefile/{fileId}', - ['as' => 'userfile.destroy', 'uses' => 'Users\UserFilesController@destroy'] + ['as' => 'userfile.destroy', 'uses' => [Users\UserFilesController::class, 'destroy']] ); Route::post( '{userId}/password', [ 'as' => 'users.password', - 'uses' => 'Users\UsersController@sendPasswordReset', + 'uses' => [Users\UsersController::class, 'sendPasswordReset'], ] ); Route::get( '{userId}/print', - ['as' => 'users.print', 'uses' => 'Users\UsersController@printInventory'] + ['as' => 'users.print', 'uses' => [Users\UsersController::class, 'printInventory']] ); Route::get( '{userId}/showfile/{fileId}', - ['as' => 'show/userfile', 'uses' => 'Users\UserFilesController@show'] + ['as' => 'show/userfile', 'uses' => [Users\UserFilesController::class, 'show']] ); Route::post( 'bulkedit', [ 'as' => 'users/bulkedit', - 'uses' => 'Users\BulkUsersController@edit', + 'uses' => [Users\BulkUsersController::class, 'edit'], ] ); Route::post( 'bulksave', [ 'as' => 'users/bulksave', - 'uses' => 'Users\BulkUsersController@destroy', + 'uses' => [Users\BulkUsersController::class, 'destroy'], ] ); Route::post( 'bulkeditsave', [ 'as' => 'users/bulkeditsave', - 'uses' => 'Users\BulkUsersController@update', + 'uses' => [Users\BulkUsersController::class, 'update'], ] ); }); -Route::resource('users', 'Users\UsersController', [ +Route::resource('users', Users\UsersController::class, [ 'middleware' => ['auth'], 'parameters' => ['user' => 'user_id'], ]);