Skip to content

Issue with Nova - Call to undefined method Sofa\\Eloquence\\Query\\Builder::getModel() #271

Open
@villeneuve-michael

Description

@villeneuve-michael

I tried using the Mappable package on a basic model user. Upon trying to use the search field, it returns the following :

Call to undefined method Sofa\\Eloquence\\Query\\Builder::getModel()

Also the ressource will simply not load (without throwing any error, nor logging any!)

Here's my model definition:

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Sofa\Eloquence\Eloquence;
use Sofa\Eloquence\Mappable;

class User extends Authenticatable
{
    use HasFactory, Notifiable, Eloquence, Mappable;

    protected $maps = [
        'id' => 'usrID',
        'username' => 'usrPseudo',
        'first_name' => 'usrFirstName',
        'last_name' => 'usrLastName',
        'password' => 'usrPassword',
        'email' => 'usrEMail',
        'role' => 'usrRole',
        'updated_at' => 'userLastModified',
        'code' => 'ecritureGL',
    ];
}

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions