Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
villeneuve-michael opened this issue Mar 11, 2022 · 1 comment

Comments

@villeneuve-michael
Copy link

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?

@Ruitjes
Copy link

Ruitjes commented Jul 1, 2022

@villeneuve-michael Have you found a solution on how you can map the basic model user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants