下面是我创建模态表单的代码。我怎样才能定制它的宽度?我想变小一点
->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),
])
您可以使用网格来在其中创建列
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