Hello, I am using the native Laravel auth (from Laravel 5.2) and I am getting the following error:
BadMethodCallException in Model.php line 3001:
Call to a member function getDateFormat() on a non-object (null)
in Model.php line 3001
at Model->getDateFormat() in Model.php line 2921
at Model->fromDateTime(object(Carbon)) in Model.php line 2878
at Model->setAttribute('updated_at', object(Carbon)) in Model.php line 3420
at Model->__set('updated_at', object(Carbon)) in Model.php line 1771
...
Any ideas on where to fix?
Thanks,
David
I finally fixed that using the CammoKing pull. I had to fix some issues with the MongoDBAuthServiceProvider file that was renamed to AuthServiceProvider. And after using the following auth provider:
'users' => [
'driver' => 'mongodb',
'model' => Jenssegers\Mongodb\Auth\UserModel::class,
'table' => 'users',
]
The register works, login and logout works. Now I'm having issues with the reset password.
UnexpectedValueException in PasswordBroker.php line 238:
User must implement CanResetPassword interface.
God damn! it is harder than I thought....
Same issue here, but its fun !
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;
It is not very good idea to modify files in vendor folder. Instead you should fork package or just copy that class somewhere in your app directory, modify it for your needs and extend your user model by this copied class.
not work for me
Most helpful comment
It is not very good idea to modify files in vendor folder. Instead you should fork package or just copy that class somewhere in your app directory, modify it for your needs and extend your user model by this copied class.