I installed jenssegers/laravel package to use mongodb in my Laravel project, but when I try to install passport I get this error :
Call to a member function prepare() on null
I tried to use designmynight package, but it seems it is not compatible with jenssegers v4 that I use for Laravel 7 .
Any idea how to fix this problem?
It's Very Simple.Without any extra package it's possible.
Only edit AuthCode.php,PersonalAccessClient.php,Client.php and Token.php in this path:
"/vendor/laravel/passport/src/"
replace this line:
use Jenssegers\Mongodb\Eloquent\Model;
by this line:
use Illuminate\Database\Eloquent\Model;
Notice:if you use multi connection specific your mongo connection in all of top Model,like this:
protected $connection = 'mongodb';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With