Class 'Jenssegers\Mongodb\MongodbServiceProvider' not found
11,282
Solution 1
run composer dump-autoload
or php artisan optimize
Solution 2
I didn't have the archive: myproject/vendor/jenssegers.
I installed this archive by command:
$ composer require jenssegers/mongodb
Solution 3
Delete Following Files and Use This Step :
composer.lock
bootstrap/cache/config.php
if exist
bootstrap/cache/services.php
then Run this command :
composer install
php artisan config:cache
Author by
George Chumburidze
Updated on June 14, 2022Comments
-
George Chumburidze almost 2 years
I want to use https://github.com/jenssegers/laravel-mongodb for connecting to Mongodb with laravel 5, i have installed MongoDB php driver and then laravel-mongodb with command
composer require jenssegers/mongodb
, then added service provider in app/config/app.php:'Jenssegers\Mongodb\MongodbServiceProvider',
and refreshed my website, unfortunately i got error ->
FatalErrorException in compiled.php line 6466: Class 'Jenssegers\Mongodb\MongodbServiceProvider' not found
how can i fix it?
-
George Chumburidze about 9 yearsi have used
composer dump -o
composer dump-autoload
and both of this functions worked but no success -
George Chumburidze about 9 years
php artisan optimize
got error 'could not open file artisan' -
darioguarascio about 9 yearsyou should be in your project root directory, where the file
artisan
is located. Anyway, try to remove the compiled.php file, and refresh the page -
darioguarascio about 9 yearsalso, do you have the file
vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/MongodbServiceProvider.php
? -
George Chumburidze about 9 yearsthere is not jenssegers in vendors folder ... it seem i have installed it in another folder how can i install it in desired directory ?
-
darioguarascio about 9 yearsassuming you are under unix, go to your desired folder, then run:
composer require jenssegers/mongodb
be sure to be in the same directory of theartisan
file -
Ashish over 5 yearsgetting same error and i m in same directory where artisan file available