2016-12-15 19:17:07 -08:00
|
|
|
<?php
|
2021-11-15 20:20:10 -08:00
|
|
|
|
|
|
|
use App\Http\Controllers\CustomFieldsController;
|
|
|
|
use App\Http\Controllers\CustomFieldsetsController;
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
2016-12-15 19:17:07 -08:00
|
|
|
/*
|
|
|
|
* Custom Fields Routes
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-11 05:16:56 -08:00
|
|
|
Route::group([ 'prefix' => 'fields','middleware' => ['auth'] ], function () {
|
2016-12-15 19:17:07 -08:00
|
|
|
|
2021-11-15 20:16:40 -08:00
|
|
|
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',
|
2022-01-26 12:43:20 -08:00
|
|
|
[CustomFieldsetsController::class, 'associate']
|
2021-11-15 20:16:40 -08:00
|
|
|
)->name('fieldsets.associate');
|
|
|
|
|
|
|
|
Route::resource('fieldsets', CustomFieldsetsController::class, [
|
2016-12-15 19:17:07 -08:00
|
|
|
'parameters' => ['fieldset' => 'field_id', 'field' => 'field_id']
|
|
|
|
]);
|
2020-04-24 00:39:32 -07:00
|
|
|
|
|
|
|
|
2016-12-15 19:17:07 -08:00
|
|
|
});
|
2017-01-25 04:34:11 -08:00
|
|
|
|
2021-11-15 20:16:40 -08:00
|
|
|
Route::resource('fields', CustomFieldsController::class, [
|
2017-03-11 05:16:56 -08:00
|
|
|
'middleware' => ['auth'],
|
2021-11-15 20:16:40 -08:00
|
|
|
'parameters' => ['field' => 'field_id', 'fieldset' => 'fieldset_id'],
|
2017-01-25 04:34:11 -08:00
|
|
|
]);
|
2021-11-15 20:16:40 -08:00
|
|
|
|