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

Support: Many To Many Relationship between fields #71

Open
Peterragheb opened this issue Aug 23, 2020 · 4 comments
Open

Support: Many To Many Relationship between fields #71

Peterragheb opened this issue Aug 23, 2020 · 4 comments

Comments

@Peterragheb
Copy link

Peterragheb commented Aug 23, 2020

I'm trying to use this package for many to many relationship
I have a Platform belongsToMany Project
and Project belongsTo many Platform

NovaBelongsToDepend::make('Project', 'project', Project::class),

NovaBelongsToDepend::make('Affected Platforms','affectedPlatforms',SupportedPlatform::class)
                ->optionsResolve(function ($project) {
                    return \App\SupportedPlatform::whereHas('projects', function ($q) use ($project) {
                        $q->where('project_id', $project->id);
                    })->get();
                })
            ->dependsOn('Project')
            ->rules('required'),

But I get Method Illuminate\Database\Eloquent\Collection::getKey does not exist.

What am I doing wrong?
Also is it possible to select multiple options?

@deepraj-sinha
Copy link

@Peterragheb did you got any solution?

@ArduanovDanil
Copy link

@orlyapps, hello! I have same issue. Is there any solution?

@ikramooe
Copy link

Having the same issue

@dan-lutd
Copy link

I also get the error

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

5 participants