public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Group::make()
->schema([
Forms\Components\Section::make($this->entity->name)
->schema([
Repeater::make('exhibitionWines')
->label("Vini per evento")
->relationship()
->simple(
Forms\Components\Select::make('wine_id')
->relationship('wine', 'name')
// ->options(Wine::where('winery_id', '=', auth()->user()->winery->id)->get()->pluck('name', 'id'))
->native(false)
->preload(),
)->addActionLabel('Aggiungi Vino all\'evento'),
])->compact()
])->columnSpan(2),
])
->columns(4)
->model($this->entity)
->statePath('entityData');
}
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Group::make()
->schema([
Forms\Components\Section::make($this->entity->name)
->schema([
Repeater::make('exhibitionWines')
->label("Vini per evento")
->relationship()
->simple(
Forms\Components\Select::make('wine_id')
->relationship('wine', 'name')
// ->options(Wine::where('winery_id', '=', auth()->user()->winery->id)->get()->pluck('name', 'id'))
->native(false)
->preload(),
)->addActionLabel('Aggiungi Vino all\'evento'),
])->compact()
])->columnSpan(2),
])
->columns(4)
->model($this->entity)
->statePath('entityData');
}