snipe-it/routes/web/fields.php

42 lines
1.1 KiB
PHP
Raw Normal View History

<?php
/*
* Custom Fields Routes
*/
Route::group([ 'prefix' => 'fields','middleware' => ['auth'] ], function () {
Route::post(
'required/{fieldset_id}/{field_id}',
[CustomFieldsetsController::class, 'makeFieldRequired']
)->name('fields.required');
Route::post(
'optional/{fieldset_id}/{field_id}',
[CustomFieldsetsController::class, 'makeFieldOptional']
)->name('fields.optional');
Route::post(
'{field_id}/fieldset/{fieldset_id}/disassociate',
[CustomFieldsController::class, 'deleteFieldFromFieldset']
)->name('fields.disassociate');
Route::post(
'fieldsets/{id}/associate',
[CustomFieldsController::class, 'associate']
)->name('fieldsets.associate');
Route::resource('fieldsets', CustomFieldsetsController::class, [
'parameters' => ['fieldset' => 'field_id', 'field' => 'field_id']
]);
});
Route::resource('fields', CustomFieldsController::class, [
'middleware' => ['auth'],
'parameters' => ['field' => 'field_id', 'fieldset' => 'fieldset_id'],
]);