0

I want to use "Jenssegers\Mongodb" package in a Laravel 5.5 app. The package documentation tells to use:

use Jenssegers\Mongodb\Eloquent\Model;
class User extends Model {}

instead of:

use Illuminate\Database\Eloquent\Model;
class User extends Model {}

But, inUser model:

class User extends Authenticatable{}

and in "Illuminate\Foundation\Auth\User" class (what 'Authenticatable' refers to) it's using Illuminate\Database\Eloquent\Model not Jenssegers\Mongodb\Eloquent\Model.

I found this solution to extend what 'Authenticatable' extends directly in my model instead of extending 'Authenticatable' itself, so that I can use Jenssegers\Mongodb\Eloquent\Model;

Is there another better solution or should I make it like that??

Rowayda Khayri
  • 489
  • 1
  • 9
  • 21
  • Have you tried the part [Extensions Auth](https://github.com/jenssegers/laravel-mongodb#auth) on that same page? – brombeer Jul 20 '18 at 10:37
  • @kerbholz I think I should use this only if I'm using password reminders as it's mentioned there. It doesn't relate to my problem. – Rowayda Khayri Jul 20 '18 at 10:49

1 Answers1

3

use Jenssegers\Mongodb\Auth\User as Authenticatable;

then

class User extends Authenticatable

mirko
  • 31
  • 2