justgkp
Explore posts from serversDynamic fields based on a select option won't working adding extra Grid or Section
I was trying to add an extra Grid inside select option. It is not working as expected. Without Grid or Section it's working. Please fix it.
Grid::make(2)
->schema(fn (Get $get): array => match ($get('type')) {
'employee' => [
//NOT RESPONDING AFTER ADDING AN EXTRA GRID
Grid::make()
->schema([
TextInput::make('employee_number')
->required(),
FileUpload::make('badge')
->image()
->required(),
]),
//IF I ADD A GRID OR SECTION AFTER THE FIRST COMPONENT, ITS WORKING....
Grid::make()
->schema([
TextInput::make('employee_number')
->required(),
FileUpload::make('badge')
->image()
->required(),
]),
],
'freelancer' => [
TextInput::make('hourly_rate')
->numeric()
->required()
->prefix('€'),
FileUpload::make('contract')
->required(),
],
default => [],
})
->key('dynamicTypeFields')
4 replies
RichEditor showing undefined in view page
RichEditor not showing content properly.
Forms\Components\Section::make()
->schema([
Forms\Components\RichEditor::make('growth')
->toolbarButtons([
'attachFiles',
'blockquote',
'bold',
'bulletList',
'codeBlock',
'h2',
'h3',
'italic',
'link',
'orderedList',
'redo',
'strike',
'undo',
])
->columnSpanFull(),
2 replies