when i run => php artisan passport:install
it give me => Call to a member function getDateFormat() on null
this my User Model :
namespace App;
use Illuminate\Notifications\Notifiable;
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
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 Eloquent 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',
];
}
The problem is that the "Client" model used by Laravel Passport extends Illuminate\Database\Eloquent\Model when it should extend Jenssegers\Mongodb\Eloquent\Model. I think we'll need to change every model used by Laravel Passport. Maybe that is the only way, not sure though.
thanks jpellissari for the response , i think this repo will take much time to be integrated with all new laravel 5.3 components
I was not able to test all the new features of Laravel 5.3 yet, but I can tell you that the laravel passport isn't a issue with this repo itself. This would be easily solved if laravel passport had treated client and token models as the user model, for example. Then we could easily be able to change the extended Model. I have a working laravel passport installation with this repo. The changes I had to make to achieve this was the changes above and the implementation of findForPassport() method on user model, because Laravel passport expects email by default when generating tokens. Btw, I've used password grant type.
Good news, Passport support is now available on moloquent. (fafa51eb2ed4c43d1882c87917e9fe1f9985829e).
Read more here: https://moloquent.github.io/master/#passport
Call to a member function getDateFormat() on nul
In the file vendor/laravel/framework/src/Illuminate/Foundation/Auth/User.php
Replace use Illuminate\Database\Eloquent\Model; for this
use Jenssegers\Mongodb\Eloquent\Model as Model;
I tried above solution but it didn't work for me.
Please help me if there is any other solution.

The problem is because of you are trying to use a class in the vendor folder that is tight to normal Eloquent Model.
What I suggest to do is taking ownership of that class in your project.
You can copy the Passport class that has the problem in your project and change the Model
Jenssegers\Mongodb\Eloquent\Model as Model;
I have the same for the Authentication as is working more than find.
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Jenssegers\Mongodb\Eloquent\Model as Model;
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 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',
];
}
This is fixed with https://github.com/jenssegers/laravel-mongodb/pull/1333
Most helpful comment
For Laravel 5.3
Call to a member function getDateFormat() on nul
In the file vendor/laravel/framework/src/Illuminate/Foundation/Auth/User.php
Replace
use Illuminate\Database\Eloquent\Model;for thisuse Jenssegers\Mongodb\Eloquent\Model as Model;Its Works