Action::make('Opleiding inplannen')
->form([
Select::make('education_id')
->label('')
->options(Education::orderBy('name', 'asc')->pluck('name', 'id'))
->required()
->live()
->afterStateUpdated(fn (Select $component) => $component
->getContainer()
->getComponent('planningForm')
->getChildComponentContainer()
->fill()
),
Grid::make(2)
->schema(function(Get $get){
$educationId = $get('education_id');
if($educationId){
return Educations::getPlanningFormSchemaArray(
Education::find($educationId)
);
}
return [];
})
->key('planningForm')
])
->action(function(array $data){
})
->slideOver()
->after(function($data){
$url = route('filament.admin.resources.education.edit', ['record' => $data['education_id']]).'?openPlanningForm=true';
return redirect($url);
}),
Action::make('Opleiding inplannen')
->form([
Select::make('education_id')
->label('')
->options(Education::orderBy('name', 'asc')->pluck('name', 'id'))
->required()
->live()
->afterStateUpdated(fn (Select $component) => $component
->getContainer()
->getComponent('planningForm')
->getChildComponentContainer()
->fill()
),
Grid::make(2)
->schema(function(Get $get){
$educationId = $get('education_id');
if($educationId){
return Educations::getPlanningFormSchemaArray(
Education::find($educationId)
);
}
return [];
})
->key('planningForm')
])
->action(function(array $data){
})
->slideOver()
->after(function($data){
$url = route('filament.admin.resources.education.edit', ['record' => $data['education_id']]).'?openPlanningForm=true';
return redirect($url);
}),