Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to implement on normal select not model? #105

Open
ZoreAnkit opened this issue Oct 23, 2021 · 0 comments
Open

how to implement on normal select not model? #105

ZoreAnkit opened this issue Oct 23, 2021 · 0 comments

Comments

@ZoreAnkit
Copy link

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 ZoreAnkit changed the title Normal select not model! how to implement on normal select not model? Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant