1Color::make()2 ->name('featured')
1<x-twill::color2 name="main_color"3 label="Main color"4/>
1@formField('color', [2 'name' => 'main_color',3 'label' => 'Main color'4])
Option | Description | Type | Default value |
---|---|---|---|
name | Name of the field | string | |
label | Label of the field | string | |
default | The default value | string |
A migration to save a color
field would be:
1Schema::table('posts', function (Blueprint $table) {2 ...3 $table->string('main_color', 10)->nullable();4 ...5});