Skip to content

Instantly share code, notes, and snippets.

@bramnauta
Created October 25, 2017 08:45
Show Gist options
  • Select an option

  • Save bramnauta/513ca76f4ff7811583fe91372ce6ddab to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

thanks for the solution, it worked.

mongodb/laravel-mongodb#1341

@nanitouto

Copy link
Copy Markdown

thanks! It works

@jmbass

jmbass commented May 4, 2018

Copy link
Copy Markdown

This works. Thank you!

@pacakman

Copy link
Copy Markdown

it doesnt work for me

@vahidalvandi

Copy link
Copy Markdown

this work fine in laravel 5.6

@Cponcax

Cponcax commented Jan 30, 2020

Copy link
Copy Markdown

Thank!!

@Cponcax

Cponcax commented Jan 30, 2020

Copy link
Copy Markdown

Working for me in lumen 6

@rajkumarbhatia

Copy link
Copy Markdown

You saved my day Bro

@pife00

pife00 commented Nov 18, 2020

Copy link
Copy Markdown

Thank you man

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