Change layout in a modal form

->form([
Select::make('order_id')
->options(function (?Product $product) {
return Order::select('id', DB::raw('CONCAT(\'Openstaande order van \', DATE_FORMAT(created_at, "%d-%m-%Y")) as concatenated_value'))
->where('brand_id', $product->brand_id)
->where('sent', false)
->whereNull('deleted_at')
->pluck('concatenated_value', 'id')
->toArray();
})
->label('Order')
->searchable()
->preload()
->columnSpan(3)
->required(),
Select::make('type')
->label('Type')
->required()
->options(OrderGoal::class),
TextInput::make('quantity')
->numeric()
->label('Aantal')
->required(),
TextInput::make('reference')
->label('Referentienummer'),
TextInput::make('remarks')
->label('Opmerkingen'),
]),
->form([
Select::make('order_id')
->options(function (?Product $product) {
return Order::select('id', DB::raw('CONCAT(\'Openstaande order van \', DATE_FORMAT(created_at, "%d-%m-%Y")) as concatenated_value'))
->where('brand_id', $product->brand_id)
->where('sent', false)
->whereNull('deleted_at')
->pluck('concatenated_value', 'id')
->toArray();
})
->label('Order')
->searchable()
->preload()
->columnSpan(3)
->required(),
Select::make('type')
->label('Type')
->required()
->options(OrderGoal::class),
TextInput::make('quantity')
->numeric()
->label('Aantal')
->required(),
TextInput::make('reference')
->label('Referentienummer'),
TextInput::make('remarks')
->label('Opmerkingen'),
]),
I would like to split the last to inputs evenly on the bottom row. But I can't find how to fix layout in a modal. Any suggestions?
Solution:
its a form layout component you can use it anywhere like an input https://filamentphp.com/docs/3.x/forms/layout/grid...
Jump to solution
3 Replies
Lara Zeus
Lara Zeus9mo ago
try Grid::make([...])->columns(2)
JJSanders
JJSandersOP9mo ago
Where sould I do that : in the form() function?
Solution
Lara Zeus
Lara Zeus9mo ago
its a form layout component you can use it anywhere like an input https://filamentphp.com/docs/3.x/forms/layout/grid
Want results from more Discord servers?
Add your server