LaravelのMongodb操作パッケージjenssegers/mongodbを使って
Laravel同梱のAuthモジュールのデータベースをMongoDBに変えてみた。
ご参考程度で
環境情報
laradock
PHP7.2
Laravel 5.6
jenssegers/mongodb 3.4
App\User.php
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
// ## ここが入れ替えの部分
//use Illuminate\Foundation\Auth\User as Authenticatable;
use Jenssegers\Mongodb\Auth\User as Authenticatable;
class User extends Authenticatable
{
use 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',
];
}