如何自定义在filament php中createOptionForm方法创建的模态表单的宽度

问题描述 投票:0回答:1

下面是我创建模态表单的代码。我怎样才能定制它的宽度?我想变小一点

->createOptionForm([
                        Forms\Components\TextInput::make('name')
                            ->required()
                            ->maxLength(255)
                            ->unique(modifyRuleUsing: function (Unique $rule) {
                                return $rule->where('user_id', auth()->id());
                            }),
                        Forms\Components\TextInput::make('stock')
                            ->required()
                            ->integer()
                            ->minValue(1)
                            ->maxLength(255),
                    ])
laravel laravel-filament filamentphp
1个回答
0
投票

您可以使用网格来在其中创建列

Grid::make(8)->schema([
                        Forms\Components\TextInput::make('name')
                            ->required()
                            ->maxLength(255)
                            ->unique(modifyRuleUsing: function (Unique $rule) {
                                return $rule->where('user_id', auth()->id());
                            })
                            ->columnSpan(4),
                        Forms\Components\TextInput::make('stock')
                            ->required()
                            ->integer()
                            ->minValue(1)
                            ->maxLength(255)
                            ->columnSpan(4),
                    ])

了解详情; https://filamentphp.com/docs/3.x/infolists/layout/grid#grid-component

© www.soinside.com 2019 - 2024. All rights reserved.