I'm trying to use this package: "ziffmedia / nova-select-plus" (https://github.com/ziffmedia/nova-select-plus)
But I have this error: "Call to undefined method App \ Models \ Tags:: newModel () "
I need this: associate tags (already present in the tags table) to the user, storing the association in the pivot_user_tags table
this is my code:
- user table
- tags table
Schema::create('ad_tag_pivot', function (Blueprint $table) { $table->id(); $table->text('title', 255); $table->timestamps(); });
- pivot_user_tags table
Schema::create('pivot_user_tags table', function (Blueprint $table) { $table->id(); $table->integer('user_id')->unsigned(); $table->integer('tag_id')->unsigned(); $table->timestamps(); });
in app/Nova/User.php:
SelectPlus::make('Tags', 'tags', 'App\Models\Tags')->label('title'),
in app/Models/Tags.php
public function tags()
{
return $this->belongsToMany('App\Models\Tags', 'pivot_user_tags table', 'user_id', 'tag_id');
}
when i go to edit user, i get the error: Call to undefined method App \ Models \ Tags:: newModel ()
can you help me?