FilamentF
Filament7mo ago
Hagi

Grid and Columns in v4

I am a little confused with the new grid & columns format in v4, because when I use grid columns the results are not the same. Can you help me?

Code :

public static function configure(Schema $schema): Schema
{
return $schema
->components([
Grid::make()
->schema([
Section::make()
->schema([
TextInput::make('name')
->label('Name')
->required()
->columnSpanFull()
->inlineLabel()
->reactive(),
TextInput::make('email')
->label('Email')
->columnSpanFull()
->required()
->inlineLabel(),
TextInput::make('password')
->password()
->inlineLabel()
->columnSpanFull()
->dehydrateStateUsing(fn ($state) => Hash::make($state))
->dehydrated(fn ($state) => filled($state))
->required(fn (string $context): bool => $context === 'create'),
DateTimePicker::make('email_verified_at')
->label('Email Verifikasi')
->columnSpanFull()
->inlineLabel(),
])
->columnSpan(3)
])
->columns(3),
]);

}
image.png
Solution
If that's all you have your Grid seems unnecessary. You can put ->columns(3) on the Form itself.
Was this page helpful?