Custom Fields
- Laraship comes with Custom Field Manager where you can attach your own fields to different Laraship Models
- Under Administration -> Custom Modules Click create to create your new field
- Supported Custom field types are :
- Text
- Text Area
- Date
- Multi-Select
- Checkbox
- Radio
- Number
- Drop Down
- You Can Add Your validation to the field, please refer to Larave validation rules: https://laravel.com/docs/5.5/validation#available-validation-rules
- To get Custom field value for a specific model :
$model->getCustom('field_name')
- Custom fields can also be managed by module config file for example to add a dropdown field
'custom_fields' => [ [ 'name' => 'file_mimes', 'type' => 'select', 'status' => 'active', 'label' => 'Acceptable Mimes', 'validation_rules' => 'required', 'custom_attributes' => [ [ 'key' => 'multiple', 'value' => 'multiple' ] ], 'options_options' => [ 'source' => 'static', ], 'options' => [ ['key' => 'mov', 'value' => 'Apple QuickTime movie file (mov)'], ['key' => 'mp3', 'value' => 'MPEG layer 3 audio file (mp3)'], ['key' => 'mp4', 'value' => 'MPEG 4 video (mp4)'], ]],