nova-belongsto-depend icon indicating copy to clipboard operation
nova-belongsto-depend copied to clipboard

how to implement on normal select not model?

Open ZoreAnkit opened this issue 3 years ago • 0 comments

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"

ZoreAnkit avatar Oct 23 '21 08:10 ZoreAnkit