You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depending on how you want to structure data you really have many choices here: one boolean column per value, one json column storing selected values, a belongsToMany relationship, etc.
In the repository section of the documentation you'll find that Twill gives you hooks to prepare data before saving (prepareFieldsBeforeSave), save more data after the model itself has been saved (afterSave) and to format data out of the database to feed your form fields if the data structure doesn't match 1 to 1 (getFormFields).
If you find yourself having to repeat code across multiple models, you can use the same approach Twill takes to share features through PHP traits. It is inspired by Laravel trait booting where the name of the hook in the trait contains the name of the trait itself. For example in Twill, the HandleMedias trait defines a afterSaveHandleMedias method that is called by the afterSave method of the repository including that trait.
`@extends('twill::layouts.form')
@section('contentFields')
@formfield('checkboxes', [
'name' => 'attributes',
'label' => 'Attributes',
'inline' => false,
'options' => [
[
'value' => 'text',
'label' => 'Text'
],
[
'value' => 'textarea',
'label' => 'Textarea'
],
[
'value' => 'editor',
'label' => 'WYSIWYG Editor'
],
[
'value' => 'image',
'label' => 'Image'
],
[
'value' => 'file',
'label' => 'File Upload'
],
]
])
@Stop
`
I can't able to save multiple select in table field. How i can save this.
The text was updated successfully, but these errors were encountered: