Skip to content

Field Declaration

tanthammar edited this page Oct 5, 2020 · 2 revisions

All fields must use the make method.

make($label, $name = null)

$label

The label to use for the form field, e.g. First Name.

$name

The name to use for the form field. If null, it will use a snake cased $label.

Basic field example:

 Input::make('First Name')->rules('required|min:2'),

Relationship field example:

$brand_options = Brand::orderBy('name')->pluck('id', 'name');

Select::make('Brand', 'brand_id')
    ->options($brand_options)
    ->rules(['required', Rule::exists('brands', 'id')])
Clone this wiki locally