More updated routes

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2021-06-12 01:35:29 -07:00
parent 346d879344
commit 17fb56d3b9
4 changed files with 208 additions and 59 deletions

View file

@ -8,7 +8,7 @@ use Illuminate\Support\Facades\Route;
Route::group(['prefix' => 'consumables', 'middleware' => ['auth']], function () {
Route::get(
'{consumablesID}/checkout',
[Consumables\ConsumableCheckoutController, 'create']
[Consumables\ConsumableCheckoutController::class, 'create']
)->name('checkout/accessory');
Route::post(

View file

@ -9,32 +9,49 @@ use Illuminate\Support\Facades\Route;
*/
Route::group(['prefix' => 'fields', 'middleware' => ['auth']], function () {
Route::get('required/{fieldset_id}/{field_id}',
['uses' => [CustomFieldsetsController::class, 'makeFieldRequired'],
'as' => 'fields.required', ]
);
Route::get('optional/{fieldset_id}/{field_id}',
['uses' => [CustomFieldsetsController::class, 'makeFieldOptional'],
'as' => 'fields.optional', ]
);
Route::get(
'required/{fieldset_id}/{field_id}',
[
CustomFieldsetsController::class,
'makeFieldRequired'
]
)->name('fields.required');
Route::get('{field_id}/fieldset/{fieldset_id}/disassociate',
['uses' => [CustomFieldsController::class, 'deleteFieldFromFieldset'],
'as' => 'fields.disassociate', ]
);
Route::get(
'optional/{fieldset_id}/{field_id}',
[
CustomFieldsetsController::class,
'makeFieldOptional'
]
)->name('fields.optional');
Route::post('fieldsets/{id}/associate',
['uses' => [CustomFieldsetsController::class, 'associate'],
'as' => 'fieldsets.associate', ]
);
Route::get(
'{field_id}/fieldset/{fieldset_id}/disassociate',
[
CustomFieldsetsController::class,
'deleteFieldFromFieldset'
]
)->name('fields.disassociate');
Route::get(
'fieldsets/{id}/associate',
[
CustomFieldsetsController::class,
'associate'
]
)->name('fields.associate');
Route::resource('fieldsets', CustomFieldsetsController::class, [
'parameters' => ['fieldset' => 'field_id', 'field' => 'field_id'],
]);
});
'parameters' => ['fieldset' => 'field_id', 'field' => 'field_id'],
]);
Route::resource('fields', CustomFieldsController::class, [
});
Route::resource('fields', CustomFieldsetsController::class, [
'middleware' => ['auth'],
'parameters' => ['field' => 'field_id', 'fieldset' => 'fieldset_id'],
'parameters' => ['field' => 'field_id'],
]);

View file

@ -5,15 +5,75 @@ use App\Http\Controllers\BulkAssetModelsController;
use Illuminate\Support\Facades\Route;
// Asset Model Management
Route::group(['prefix' => 'models', 'middleware' => ['auth']], function () {
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::get(
'{modelId}/clone',
[
AssetModelsController::class,
'getClone'
]
)->name('clone/model');
Route::post(
'{modelId}/clone',
[
AssetModelsController::class,
'postCreate'
]
)->name('clone/model');
Route::get(
'{modelId}/view',
[
AssetModelsController::class,
'getView'
]
)->name('view/model');
Route::get(
'{modelID}/restore',
[
AssetModelsController::class,
'getRestore'
]
)->name('restore/model');
Route::get(
'{modelId}/custom_fields',
[
AssetModelsController::class,
'getCustomFields'
]
)->name('custom_fields/model');
Route::post(
'bulkedit',
[
BulkAssetModelsController::class,
'edit'
]
)->name('models.bulkedit.index');
Route::post(
'bulksave',
[
BulkAssetModelsController::class,
'update'
]
)->name('models.bulkedit.store');
Route::post(
'bulkdelete',
[
BulkAssetModelsController::class,
'destroy'
]
)->name('models.bulkdelete.store');
});
Route::resource('models', AssetModelsController::class, [

View file

@ -4,59 +4,131 @@ use App\Http\Controllers\Users;
use Illuminate\Support\Facades\Route;
// User Management
Route::group(['prefix' => 'users', 'middleware' => ['auth']], function () {
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::get(
'ldap',
[
Users\LDAPImportController::class,
'create'
]
)->name('ldap/user');
Route::post(
'ldap',
[
Users\LDAPImportController::class,
'store'
]
);
Route::get(
'export',
[
Users\UsersController::class,
'getExportUserCsv'
]
)->name('users.export');
Route::get(
'{userId}/clone',
[
Users\UsersController::class,
'getClone'
]
)->name('clone/user');
Route::post(
'{userId}/clone',
[
Users\UsersController::class,
'postCreate'
]
)->name('clone/user');
Route::get(
'{userId}/restore',
[
Users\UsersController::class,
'getRestore'
]
)->name('restore/user');
Route::get(
'{userId}/unsuspend',
[
Users\UsersController::class,
'getUnsuspend'
]
)->name('unsuspend/user');
Route::post(
'{userId}/upload',
[
Users\UserFilesController::class,
'store'
]
)->name('upload/user');
Route::delete(
'{userId}/deletefile/{fileId}',
['as' => 'userfile.destroy', 'uses' => [Users\UserFilesController::class, 'destroy']]
);
[
Users\UserFilesController::class,
'destroy'
]
)->name('userfile.destroy');
Route::get(
'{userId}/showfile/{fileId}',
[
Users\UserFilesController::class,
'show'
]
)->name('show/userfile');
Route::post(
'{userId}/password',
[
'as' => 'users.password',
'uses' => [Users\UsersController::class, 'sendPasswordReset'],
Users\UsersController::class,
'sendPasswordReset'
]
);
)->name('users.password');
Route::get(
'{userId}/print',
['as' => 'users.print', 'uses' => [Users\UsersController::class, 'printInventory']]
);
Route::get(
'{userId}/showfile/{fileId}',
['as' => 'show/userfile', 'uses' => [Users\UserFilesController::class, 'show']]
);
[
Users\UsersController::class,
'printInventory'
]
)->name('users.print');
Route::post(
'bulkedit',
[
'as' => 'users/bulkedit',
'uses' => [Users\BulkUsersController::class, 'edit'],
Users\BulkUsersController::class,
'edit'
]
);
)->name('users/bulkedit');
Route::post(
'bulksave',
[
'as' => 'users/bulksave',
'uses' => [Users\BulkUsersController::class, 'destroy'],
Users\BulkUsersController::class,
'destroy'
]
);
)->name('users/bulksave');
Route::post(
'bulkeditsave',
[
'as' => 'users/bulkeditsave',
'uses' => [Users\BulkUsersController::class, 'update'],
Users\BulkUsersController::class,
'update'
]
);
)->name('users/bulkeditsave');
});
Route::resource('users', Users\UsersController::class, [