Download the PHP package moonshine/layouts-field without Composer
On this page you can find all versions of the php package moonshine/layouts-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download moonshine/layouts-field
More information about moonshine/layouts-field
Files in moonshine/layouts-field
Package layouts-field
Short Description Field for repeating groups of fields for MoonShine
License MIT
Homepage https://moonshine-laravel.com
Informations about the package layouts-field
Layouts field for MoonShine
Requirements
- MoonShine v3.0+
Support MoonShine versions
MoonShine | Layouts |
---|---|
2.0+ | 1.0+ |
3.0+ | 2.0+ |
Quick start
Install
Usage
Field Layouts for MoonShine allows you to easily manage repeating groups of fields. You will be able to add, delete and sort groups consisting of basic fields. There are some restrictions on the use of fields in the Layouts field. You can use any basic fields except Relationships fields.
Adding layouts
Layouts can be added using the following method on your Layouts fields:
- The
$title
parameter allows you to specify the name of a group of fields that will be displayed in the form. - The
$name
parameter is used to store the chosen layout in the field's value. - The
$fields
parameter accepts an array of fields that will be used to populate a group of fields in the form. $limit
allows you to set the max number of groups in the field.
Adding cast
The field stores its values as a single JSON string. To use the Layouts field, you need to add a cast for your model.
Customizing the button label
You can change the default "Add layout" button's text using the ActionButton component:
Adding search field
You can add search input in layout list as follows:
All versions of layouts-field with dependencies
ext-curl Version *
ext-json Version *