ziffmedia / nova-select-plus

A Laravel Nova Select Field
MIT License
91 stars 26 forks source link

Relationship Resource is not a valid class #32

Closed OthmanAlseagh closed 3 years ago

OthmanAlseagh commented 3 years ago

Error Relationship Resource is not a valid class

when i use

SelectPlus::make('Employees', 'employees', \App\Models\Employee::onlyMines()->get())

OthmanAlseagh commented 3 years ago

class Services { public function employees(): BelongsToMany { return $this->belongsToMany(Employee::class); } }

this is my class

ralphschindler commented 3 years ago

Hi! See https://github.com/ziffmedia/nova-select-plus/blob/master/demo/app/Nova/Person.php#L54

The 3rd parameter to the make() method must be the class of the Resource (not the model class) you are trying to map to.