Skip to content

Instantly share code, notes, and snippets.

@bramnauta
Created October 25, 2017 08:45
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save bramnauta/513ca76f4ff7811583fe91372ce6ddab to your computer and use it in GitHub Desktop.
Save bramnauta/513ca76f4ff7811583fe91372ce6ddab to your computer and use it in GitHub Desktop.
app/User.php
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class User extends \Jenssegers\Mongodb\Eloquent\Model implements
AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract
{
use Authenticatable, Authorizable, CanResetPassword, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
}
@vijayantkatyal
Copy link

thanks for the solution, it worked.

mongodb/laravel-mongodb#1341

@nanitouto
Copy link

thanks! It works

@jmbass
Copy link

jmbass commented May 4, 2018

This works. Thank you!

@pacakman
Copy link

it doesnt work for me

@vahidalvandi
Copy link

this work fine in laravel 5.6

@Cponcax
Copy link

Cponcax commented Jan 30, 2020

Thank!!

@Cponcax
Copy link

Cponcax commented Jan 30, 2020

Working for me in lumen 6

@rajkumarbhatia
Copy link

You saved my day Bro

@pife00
Copy link

pife00 commented Nov 18, 2020

Thank you man

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment