Column Span Form Builder

I want to display all the fields separately, like one at a line. Need to use columnspan(2) on every fields and new fields should starts from new line not on the same line.
return $form

->schema([
TextInput::make('name')
->required()
->maxLength(255)
->columnSpan(1)
->autofocus(),
TextInput::make('Price')
->required()
->numeric()
->minValue(1),

Textarea::make('description')
->minLength(2)
->columnSpan(1)
->maxLength(1024),




]);
return $form

->schema([
TextInput::make('name')
->required()
->maxLength(255)
->columnSpan(1)
->autofocus(),
TextInput::make('Price')
->required()
->numeric()
->minValue(1),

Textarea::make('description')
->minLength(2)
->columnSpan(1)
->maxLength(1024),




]);
No description
Solution:
Group::make()->columns(1)->schema([...]);
Group::make()->columns(1)->schema([...]);
...
Jump to solution
6 Replies
Dennis Koch
Dennis Koch14mo ago
You probably want a Group that spans 1 column and place your fields inside the group
David warner
David warnerOP14mo ago
and how do I do that ?
Solution
Dennis Koch
Dennis Koch14mo ago
Group::make()->columns(1)->schema([...]);
Group::make()->columns(1)->schema([...]);
David warner
David warnerOP14mo ago
No description
David warner
David warnerOP14mo ago
public static function form(Form $form): Form
{
return $form

->schema([
Section::make()

->schema([
TextInput::make('name')
->required()
->maxLength(255)

->autofocus(),

TextInput::make('price')
->required()
->numeric()

->prefix('रू')
->minValue(1),

Textarea::make('description')
->minLength(2)

->maxLength(1024),
])->columns(1)->columnSpan(1),
]);
}
public static function form(Form $form): Form
{
return $form

->schema([
Section::make()

->schema([
TextInput::make('name')
->required()
->maxLength(255)

->autofocus(),

TextInput::make('price')
->required()
->numeric()

->prefix('रू')
->minValue(1),

Textarea::make('description')
->minLength(2)

->maxLength(1024),
])->columns(1)->columnSpan(1),
]);
}
achieved that by making section, thank you for your response Any easy suggestions for this?
Dennis Koch
Dennis Koch14mo ago
For what?

Did you find this page helpful?