nova-belongsto-depend
nova-belongsto-depend copied to clipboard
Support: Many To Many Relationship between fields
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?
@Peterragheb did you got any solution?
@orlyapps, hello! I have same issue. Is there any solution?
Having the same issue
I also get the error