Merge pull request #10166 from uberbrady/fix_default_values_for_custom_fields_for_models_rebased
Fix default values for custom fields for models rebased
This commit is contained in:
commit
3980c80c70
12 changed files with 104 additions and 359 deletions
|
@ -15,27 +15,21 @@ class CustomFieldSetDefaultValuesForModel extends Component
|
|||
public $fields;
|
||||
public $model_id;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
\Log::info("INSTANTIATING A THING!!!"); // WORKS!
|
||||
}
|
||||
|
||||
public function foo()
|
||||
{
|
||||
\Log::info("Uh, foo?");
|
||||
}
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->fieldset_id = AssetModel::find($this->model_id)->fieldset_id;
|
||||
\Log::error("Mount at least fired, that's got to count for something, yeah?"); //WORKS! YAY!
|
||||
$this->model = AssetModel::find($this->model_id); // It's possible to do some clever route-model binding here, but let's keep it simple, shall we?
|
||||
$this->fieldset_id = $this->model->fieldset_id;
|
||||
$this->fields = CustomFieldset::find($this->fieldset_id)->fields;
|
||||
$this->add_default_values = ( $this->model->defaultValues->count() > 0);
|
||||
}
|
||||
|
||||
public function updatedFieldsetId()
|
||||
{
|
||||
$this->fields = CustomFieldset::find($this->fieldset_id)->fields;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
// return 'fart<div>Hi: {{ $this->add_default_values }} yeah?</div>';
|
||||
return view('livewire.custom-field-set-default-values-for-model');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
use App\Models\CustomFieldset;
|
||||
|
||||
class CustomFieldsForFieldset extends Component
|
||||
{
|
||||
public $fieldset_id;
|
||||
public $fields;
|
||||
|
||||
public function render()
|
||||
{
|
||||
if($this->fieldset_id) {
|
||||
$this->fields = CustomFieldset::find($this->fieldset_id)->fields()->get();
|
||||
}
|
||||
return view('livewire.custom-fields-for-fieldset');
|
||||
}
|
||||
}
|
12
composer.lock
generated
12
composer.lock
generated
|
@ -246,16 +246,16 @@
|
|||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.195.1",
|
||||
"version": "3.195.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "7df429b9cae05b52991ae266e0f7f6756a9e7b4d"
|
||||
"reference": "7e0cdfe30ee3cfa2a1494f8e3b4fa5277f118102"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/7df429b9cae05b52991ae266e0f7f6756a9e7b4d",
|
||||
"reference": "7df429b9cae05b52991ae266e0f7f6756a9e7b4d",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/7e0cdfe30ee3cfa2a1494f8e3b4fa5277f118102",
|
||||
"reference": "7e0cdfe30ee3cfa2a1494f8e3b4fa5277f118102",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -331,9 +331,9 @@
|
|||
"support": {
|
||||
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.195.1"
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.195.2"
|
||||
},
|
||||
"time": "2021-09-28T18:16:45+00:00"
|
||||
"time": "2021-09-29T18:17:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "bacon/bacon-qr-code",
|
||||
|
|
2
public/vendor/livewire/livewire.js
vendored
2
public/vendor/livewire/livewire.js
vendored
File diff suppressed because one or more lines are too long
2
public/vendor/livewire/livewire.js.map
vendored
2
public/vendor/livewire/livewire.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/vendor/livewire/manifest.json
vendored
2
public/vendor/livewire/manifest.json
vendored
|
@ -1 +1 @@
|
|||
{"/livewire.js":"/livewire.js?id=83b555bb3e243bc25f35"}
|
||||
{"/livewire.js":"/livewire.js?id=21fa1dd78491a49255cd"}
|
|
@ -1,220 +0,0 @@
|
|||
<style scoped>
|
||||
legend {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
|
||||
fieldset > div {
|
||||
background: #f4f4f4;
|
||||
border: 1px solid #d3d6de;
|
||||
margin: 0 15px 15px;
|
||||
padding: 20px 20px 10px;
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
legend {
|
||||
text-align: left !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
fieldset > div {
|
||||
width: 55%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="show && fields.length">
|
||||
<div class="form-group">
|
||||
<fieldset>
|
||||
<legend class="col-md-3 control-label">Default Values</legend>
|
||||
<div class="col-sm-8 col-xl-7">
|
||||
<p v-if="error">
|
||||
There was a problem retrieving the fields for this fieldset.
|
||||
</p>
|
||||
<div class="row" v-for="field in fields">
|
||||
<div class="col-sm-12 col-lg-6">
|
||||
<label class="control-label" :for="'default-value' + field.id">{{ field.name }}</label>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-6">
|
||||
<input v-if="field.type == 'text'" class="form-control m-b-xs" type="text" :value="getValue(field)" :id="'default-value' + field.id" :name="'default_values[' + field.id + ']'">
|
||||
<textarea v-if="field.type == 'textarea'" class="form-control" :value="getValue(field)" :id="'default-value' + field.id" :name="'default_values[' + field.id + ']'"></textarea><br>
|
||||
|
||||
<select v-if="field.type == 'listbox'" class="form-control m-b-xs" :name="'default_values[' + field.id + ']'">
|
||||
<option value=""></option>
|
||||
<option v-for="field_value in field.field_values_array" :value="field_value" :selected="getValue(field) == field_value">{{ field_value }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: [
|
||||
'fieldsetId',
|
||||
'modelId',
|
||||
'previousInput',
|
||||
],
|
||||
|
||||
data() {
|
||||
return {
|
||||
identifiers: {
|
||||
fieldset: null,
|
||||
model: null,
|
||||
},
|
||||
elements: {
|
||||
fieldset: null,
|
||||
field: null,
|
||||
},
|
||||
fields: null,
|
||||
show: false,
|
||||
error: false,
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialise the component (Vue 1.x).
|
||||
*/
|
||||
ready() {
|
||||
this.init()
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialise the component (Vue 2.x).
|
||||
*/
|
||||
mounted() {
|
||||
this.init()
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* Grabs the toggle field and connected fieldset and if present,
|
||||
* set up the rest of the component. Scope lookups to the component
|
||||
* only so we're not traversing and/or manipulating the whole DOM
|
||||
*/
|
||||
init() {
|
||||
this.defaultValues = JSON.parse(this.previousInput);
|
||||
this.identifiers.fieldset = this.fieldsetId
|
||||
this.identifiers.model = this.modelId
|
||||
|
||||
// This has to be jQuery because a lot of native functions/events
|
||||
// do not work with select2
|
||||
this.elements.fieldset = $('.js-fieldset-field')
|
||||
|
||||
this.elements.field = document.querySelector('.js-default-values-toggler')
|
||||
|
||||
if (this.elements.fieldset && this.elements.field) {
|
||||
this.addListeners()
|
||||
this.getFields()
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds event listeners for:
|
||||
* - Toggle field changing
|
||||
* - Fieldset field changing
|
||||
*
|
||||
* Using jQuery event hooks for the select2 fieldset field as
|
||||
* select2 does not emit DOM events...
|
||||
*/
|
||||
addListeners() {
|
||||
this.elements.field.addEventListener('change', e => this.updateShow())
|
||||
this.elements.fieldset.on('change', e => this.updateFields())
|
||||
},
|
||||
|
||||
/**
|
||||
* Call the CustomFieldsetsController::fields() endpoint to grab
|
||||
* the fields we can set default values for
|
||||
*/
|
||||
getFields() {
|
||||
if (!this.identifiers.fieldset) {
|
||||
return this.fields = [];
|
||||
}
|
||||
|
||||
this.$http.get(this.getUrl())
|
||||
.then(response => response.json())
|
||||
.then(data => this.checkResponseForError(data))
|
||||
.then(data => this.fields = data.rows)
|
||||
.then(() => this.determineIfShouldShow())
|
||||
},
|
||||
|
||||
getValue(field) {
|
||||
if (field.default_value) {
|
||||
return field.default_value
|
||||
}
|
||||
|
||||
return this.defaultValues != null ? this.defaultValues[field.id.toString()] : ''
|
||||
},
|
||||
|
||||
/**
|
||||
* Generates the API URL depending on what information is available
|
||||
*
|
||||
* @return Router
|
||||
*/
|
||||
getUrl() {
|
||||
if (this.identifiers.model) {
|
||||
return route('api.fieldsets.fields-with-default-value', {
|
||||
fieldset: this.identifiers.fieldset,
|
||||
model: this.identifiers.model,
|
||||
})
|
||||
}
|
||||
|
||||
return route('api.fieldsets.fields', {
|
||||
fieldset: this.identifiers.fieldset,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets error state and shows error if request was not marked
|
||||
* successful
|
||||
*/
|
||||
checkResponseForError(data) {
|
||||
this.error = data.status == 'error'
|
||||
|
||||
return data
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks whether the toggler is checked and shows the default
|
||||
* values field dependent on that
|
||||
*/
|
||||
updateShow() {
|
||||
if (this.identifiers.fieldset && this.elements.field) {
|
||||
this.show = this.elements.field.checked
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* checks the 'add default values' checkbox if it is already checked
|
||||
* OR this.show is already set to true OR if any fields already have
|
||||
* a default value.
|
||||
*/
|
||||
determineIfShouldShow() {
|
||||
this.elements.field.checked = this.elements.field.checked
|
||||
|| this.show
|
||||
|| this.fields.reduce((accumulator, currentValue) => {
|
||||
return accumulator || currentValue.default_value
|
||||
}, false)
|
||||
|
||||
this.updateShow()
|
||||
},
|
||||
|
||||
updateFields() {
|
||||
this.identifiers.fieldset = this.elements.fieldset[0].value ? parseInt(this.elements.fieldset[0].value) : false
|
||||
this.getFields()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -31,10 +31,11 @@ Vue.component(
|
|||
require('./components/importer/importer.vue').default
|
||||
);
|
||||
|
||||
Vue.component(
|
||||
'fieldset-default-values',
|
||||
require('./components/forms/asset-models/fieldset-default-values.vue').default
|
||||
);
|
||||
// This component has been removed and replaced with a Livewire implementation
|
||||
// Vue.component(
|
||||
// 'fieldset-default-values',
|
||||
// require('./components/forms/asset-models/fieldset-default-values.vue').default
|
||||
// );
|
||||
|
||||
// Commented out currently to avoid trying to load vue everywhere.
|
||||
// const app = new Vue({
|
||||
|
|
|
@ -1,22 +1,86 @@
|
|||
<div>
|
||||
<span> {{-- This <span> doesn't seem to fix it, neither does a div? --}}
|
||||
<div class="form-group{{ $errors->has('custom_fieldset') ? ' has-error' : '' }}">
|
||||
<label for="custom_fieldset" class="col-md-3 control-label">{{ trans('admin/models/general.fieldset') }}</label>
|
||||
<div class="col-md-9">
|
||||
{{ Form::select('custom_fieldset', Helper::customFieldsetList(),old('custom_fieldset', 0000 /*$item->fieldset_id*/), array('class'=>'select2 js-fieldset-field', 'style'=>'width:350px', 'aria-label'=>'custom_fieldset', 'wire:model' => 'fieldset_id')) }}
|
||||
{!! $errors->first('custom_fieldset', '<span class="alert-msg" aria-hidden="true"><br><i class="fas fa-times"></i> :message</span>') !!}
|
||||
<label class="m-l-xs">
|
||||
{{-- {{ Form::checkbox('add_default_values', 1, Request::old('add_default_values'), ['class' => 'js-default-values-toggler']) }} --}}
|
||||
{{-- I'm not sure that *this* checkboxy thing will render right, because of things. It's not *in* its own view, right? So that's a problem --}}
|
||||
<input wire:click="foo" wire:model="add_default_values" type='checkbox' name='add_default_values' value='1' class='js-default-values-toggler'{{ Request::old('add_default_values')? " checked='checked'" : "" }} />
|
||||
{{ trans('admin/models/general.add_default_values') }}
|
||||
</label>
|
||||
</div>
|
||||
<span wire:ignore> {{-- wire:ignore is because Select 2 mangles the dom in many awful ways, and so does iCheckbox --}}
|
||||
<div class="col-md-9">
|
||||
{{ Form::select('custom_fieldset', Helper::customFieldsetList(), old('custom_fieldset', $fieldset_id), array('class'=>'select2 js-fieldset-field', 'style'=>'width:350px', 'aria-label'=>'custom_fieldset', 'wire:model' => 'fieldset_id', 'id' => 'glooobits')) }} {{-- when we have this wrapped in 'ignore', the wire:model won't work --}}
|
||||
{!! $errors->first('custom_fieldset', '<span class="alert-msg" aria-hidden="true"><br><i class="fas fa-times"></i> :message</span>') !!}
|
||||
<label class="m-l-xs">
|
||||
{{ Form::checkbox('add_default_values', 1, Request::old('add_default_values', $add_default_values), ['class' => 'minimal', 'wire:model' => "add_default_values", 'id' => 'add_default_values']) }}
|
||||
{{ trans('admin/models/general.add_default_values') }}
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@if($this->add_default_values) {{-- 'if the checkbox is enabled *AND* there are more than 0 fields in the fieldsset' --}}
|
||||
@if( $this->add_default_values ) {{-- 'if the checkbox is enabled *AND* there are more than 0 fields in the fieldsset' --}}
|
||||
<div>
|
||||
<div class="form-group">
|
||||
@livewire('custom-fields-for-fieldset',['fieldset_id' => $fieldset_id])
|
||||
@foreach ($fields as $field)
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-md-3 control-label{{ $errors->has($field->name) ? ' has-error' : '' }}" for="default-value{{ $field->id }}">{{ $field->name }}</label>
|
||||
|
||||
<div class="col-md-7">
|
||||
|
||||
@if ($field->element == "text")
|
||||
<input class="form-control m-b-xs" type="text" value="{{ $field->defaultValue($model_id) }}" id="default-value{{ $field->id }}" name="default_values[{{ $field->id }}]">
|
||||
@elseif($field->element == "textarea")
|
||||
<textarea class="form-control" id="default-value{{ $field->id }}" name="default_values[{{ $field->id }}]">{{ $field->defaultValue($model_id) }}</textarea><br>
|
||||
@elseif($field->element == "listbox")
|
||||
|
||||
<select class="form-control m-b-xs" name="default_values[{{ $field->id }}]">
|
||||
<option value=""></option>
|
||||
@foreach(explode("\r\n", $field->field_values) as $field_value)
|
||||
<option value="{{$field_value}}" {{ $field->defaultValue($model_id) == $field_value ? 'selected="selected"': '' }}>{{ $field_value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@elseif($field->element == "radio")
|
||||
@foreach(explode("\r\n", $field->field_values) as $field_value)
|
||||
<input type='radio' name="default_values[{{ $field->id }}]" value="{{$field_value}}" {{ $field->defaultValue($model_id) == $field_value ? 'checked="checked"': '' }} />{{ $field_value }}<br />
|
||||
@endforeach
|
||||
@elseif($field->element == "checkbox")
|
||||
<input type='checkbox' name="default_values[{{ $field->id }}]" {{ $field->defaultValue($model_id) ? 'checked="checked"': '' }}/>
|
||||
@else
|
||||
<span class="help-block form-error">
|
||||
Unknown field element: {{ $field->element }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<script>
|
||||
// *still* haven't figured out why this doesn't seem to work at all...
|
||||
// And even if it did, I hate having $(function () {}) as my DOM-ready checker in some places, and
|
||||
// DOMContentLoaded in another...
|
||||
/* document.addEventListener("DOMContentLoaded", function () {
|
||||
Livewire.hook('component.initialized', function (component) {
|
||||
$('#glooobits').on('select2:select',function (event) { //'change' seems to be the jquery-compatible version but I think the select2 versions might be nicer.
|
||||
console.log("Select2 has changed!!!!!")
|
||||
console.dir(event)
|
||||
@this.set('fieldset_id',event.params.data.id)
|
||||
// Livewire.first().set('fieldset_id',event.params.data.id) // I still don't know why @this does'nt work here?
|
||||
})
|
||||
|
||||
})
|
||||
}) */
|
||||
|
||||
</script>
|
||||
@push('js')
|
||||
<script>
|
||||
$(function () {
|
||||
$('#glooobits').on('select2:select',function (event) { //'change' seems to be the jquery-compatible version but I think the select2 versions might be nicer.
|
||||
{{-- @this.set('fieldset_id',event.params.data.id) --}}
|
||||
Livewire.first().set('fieldset_id',event.params.data.id) // I still don't know why @this does'nt work here?
|
||||
})
|
||||
$('#add_default_values').on('ifToggled',function (event) {
|
||||
Livewire.first().set('add_default_values',event.target.checked)
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
</span>
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
|
||||
|
||||
@empty($fields) {{-- There was an error? --}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7 col-md-offset-3 has-error">
|
||||
<span class="help-block form-error">There was a problem retrieving the fields for this fieldset.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
{{-- NOTE: This stuff could work well also for the 'view this asset and do its custom fields' thing --}}
|
||||
{{-- I don't know if we break *here* or if we break per field element? --}}
|
||||
@foreach ($fields as $field)
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-md-3 control-label{{ $errors->has($field->name) ? ' has-error' : '' }}" for="default-value{{ $field->id }}">{{ $field->name }}</label>
|
||||
|
||||
<div class="col-md-7">
|
||||
|
||||
@if ($field->element == "text")
|
||||
<input b-if="field.type == 'text'" class="form-control m-b-xs" type="text" :value="getValue(field)" :id="'default-value' + field.id" :name="'default_values[' + field.id + ']'">
|
||||
@elseif($field->element == "textarea")
|
||||
<textarea x-if="field.type == 'textarea'" class="form-control" :value="getValue(field)" :id="'default-value' + field.id" :name="'default_values[' + field.id + ']'"></textarea><br>
|
||||
@elseif($field->element == "listbox")
|
||||
|
||||
<select Z-if="field.element == 'listbox'" class="form-control m-b-xs" :name="'default_values[' + field.id + ']'">
|
||||
<option value=""></option>
|
||||
@foreach($field->field_values as $field_value)
|
||||
<option Q-for="field_value in field.field_values_array" :value="field_value" :selected="getValue(field) == field_value">{{ $field_value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@else
|
||||
<span class="help-block form-error">
|
||||
Unknown field element: {{ $field->element }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endforeach
|
||||
@endif
|
||||
|
|
@ -34,29 +34,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Custom Fieldset -->
|
||||
<div>
|
||||
{{-- <div class="form-group {{ $errors->has('custom_fieldset') ? ' has-error' : '' }}">
|
||||
<label for="custom_fieldset" class="col-md-3 control-label">{{ trans('admin/models/general.fieldset') }}</label>
|
||||
<div class="col-md-7">
|
||||
{{ Form::select('custom_fieldset', Helper::customFieldsetList(),old('custom_fieldset', $item->fieldset_id), array('class'=>'select2 js-fieldset-field', 'style'=>'width:350px', 'aria-label'=>'custom_fieldset')) }}
|
||||
{!! $errors->first('custom_fieldset', '<span class="alert-msg" aria-hidden="true"><br><i class="fas fa-times"></i> :message</span>') !!}
|
||||
<label class="m-l-xs">
|
||||
{{-- {{ Form::checkbox('add_default_values', 1, Request::old('add_default_values'), ['class' => 'js-default-values-toggler']) }} --}}
|
||||
{{-- I'm not sure that *this* checkboxy thing will render right, because of things. It's not *in* its own view, right? So that's a problem --}}
|
||||
{{-- <input wire:click="foo" wire:model="add_default_values" type='checkbox' name='add_default_values' value='1' class='js-default-values-toggler'{{ Request::old('add_default_values')? " checked='checked'" : "" }} />
|
||||
{{ trans('admin/models/general.add_default_values') }}
|
||||
</label>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
{{-- <fieldset-default-values
|
||||
model-id="{{ $item->id ?: '' }}"
|
||||
fieldset-id="{{ !empty($item->fieldset) ? $item->fieldset->id : Request::old('custom_fieldset') }}"
|
||||
previous-input="{{ json_encode(Request::old('default_values')) }}">
|
||||
</fieldset-default-values> --}}
|
||||
@livewire('custom-field-set-default-values-for-model',["model_id" => $item->id])
|
||||
|
||||
</div>
|
||||
@livewire('custom-field-set-default-values-for-model',["model_id" => $item->id])
|
||||
|
||||
@include ('partials.forms.edit.notes')
|
||||
@include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/models/general.requestable')])
|
||||
|
@ -80,12 +58,4 @@
|
|||
|
||||
@include ('partials.forms.edit.image-upload')
|
||||
|
||||
@stop
|
||||
|
||||
{{-- @section('moar_scripts')
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
new Vue({
|
||||
el: '#app'
|
||||
});
|
||||
</script>
|
||||
@endsection --}}
|
||||
@stop
|
|
@ -34,13 +34,13 @@ Route::group(['prefix' => 'fields', 'middleware' => ['auth']], function () {
|
|||
]
|
||||
)->name('fields.disassociate');
|
||||
|
||||
Route::get(
|
||||
Route::post(
|
||||
'fieldsets/{id}/associate',
|
||||
[
|
||||
CustomFieldsetsController::class,
|
||||
'associate'
|
||||
]
|
||||
)->name('fields.associate');
|
||||
)->name('fieldsets.associate');
|
||||
|
||||
Route::resource('fieldsets', CustomFieldsetsController::class, [
|
||||
'parameters' => ['fieldset' => 'field_id', 'field' => 'field_id'],
|
||||
|
|
Loading…
Add table
Reference in a new issue