nova-belongsto-depend
nova-belongsto-depend copied to clipboard
how to implement on normal select not model?
What to do in following case:
Select::make(__('Status'), 'status')->options(function () {
return [
'to_schedule' => '' . __('To Schedule') . '',
'quote_todo' => '' . __('Quote Todo') . '',
];
})
->rules('required'),
NovaBelongsToDepend::make(__('Responsible') . ' 1', 'responsible_one', Employee::class)
->placeholder(__('Select') . ' ' . __('Responsible') . ' 1')
->options(
\App\Models\Employee::all()
)->optionsResolve(function ($status) {
if ($status == 'quote_todo') {
//some code
}
})
->dependsOn('status'),
In above example I have 1 normal select field and other model select field. My model data has to be filtered depending on status.
I'm getting internal error - "Class 'App\Nova\Status' not found"