Skip to content

how to implement on normal select not model? #105

@ZoreAnkit

Description

@ZoreAnkit

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions