Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

manu123's avatar

SelectPlus: Call to undefined method ... newModel()

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?

0 likes
1 reply
lebowskichris's avatar

Hey @manu123

I was having the same issue. I believe it's due to the SelectPlus make method expecting a NovaResource class, not the actual model class.

So in my instance I have this

SelectPlus::make('Organisation types', 'organisationTypes', OrganisationType::class)

Originally I was importing my actual model class for OrganisationType but when I made a Nova resource for that model and referenced that instead, everything worked.

Hope this helps.

Please or to participate in this conversation.