A
A
AleDv2016-06-24 12:39:57
Laravel
AleDv, 2016-06-24 12:39:57

How to make Sentinel friends with your relations?

To work with users, namely for roles and permissions, I installed the Cartalyst\Sentinel package on Laravel.
Before that, I used the standard User model to work with users, for which I already managed to make several relationships of the form:

public function garageBuy()
    {
        return $this->hasMany('App\Models\Offers\GarageBuy')->orderBy('id', 'desc');
    }

After I set up the User model to work with Sentinel, having inherited the model from EloquentUser, I lost access to my relationship. Now only one relation is available to me - roles.
Tell me, how can I make my User model have both mine, custom relations, and relations from Sentinel?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AleDv, 2016-06-24
@AleDv

Understood what the problem is. You also need to configure your model in the configs:

'users' => [

        //'model' => 'Cartalyst\Sentinel\Users\EloquentUser',
        'model' => 'App\Models\User',

    ],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question