Skip to content

FatalThrowableError in Client.php line 58: Class 'MongoDB\Driver\Manager' not found #863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nigeltiany opened this issue Jun 11, 2016 · 0 comments

Comments

@nigeltiany
Copy link

nigeltiany commented Jun 11, 2016

This error is really out there stopping people's progress on their work. Its doing it for me. I've searched for answers everywhere but it is still an unsolved issue. My php_extension for mongo.dll is enabled and showing.

This seeder however actually works...

`

class MongoSeed extends Seeder{
/**
 * Run the database seeds.
 *
 * @return void
 */
public function run()
{
    $mongoSeed = new Author();
    $mongoSeed->name = 'Nigel';
    $mongoSeed->email = '[email protected]';
    $mongoSeed->save();
}
}

`

but this doesn't work from my controller

`

public function postQuote(Request $request){
    $quote = $request['quote'];
    $author = $request['author'];

    $mongoSeed = new Author();
    $mongoSeed->name = 'James';
    $mongoSeed->email = '[email protected]';
    $mongoSeed->save();

    return redirect()->route('home')->with([
        'success' => 'Quote Saved'
    ]);
}
}`

Here are the errors...

in Client.php line 58 at Client->__construct('mongodb://ds013004.mlab.com:13004/laravel', array('database' => 'laravel', 'username' => 'user', 'password' => 'user'), array('typeMap' => array('array' => 'MongoDB\Model\BSONArray', 'document' => 'MongoDB\Model\BSONDocument', 'root' => 'MongoDB\Model\BSONDocument'))) in Connection.php line 147 at Connection->createConnection('mongodb://ds013004.mlab.com:13004/laravel', array('driver' => 'mongodb', 'host' => 'ds013004.mlab.com', 'port' => '13004', 'database' => 'laravel', 'username' => 'user', 'password' => 'user', 'options' => array('database' => 'laravel')), array('database' => 'laravel', 'username' => 'user', 'password' => 'user')) in Connection.php line 37 at Connection->__construct(array('driver' => 'mongodb', 'host' => 'ds013004.mlab.com', 'port' => '13004', 'database' => 'laravel', 'username' => 'user', 'password' => 'user', 'options' => array('database' => 'laravel'))) in MongodbServiceProvider.php line 27 at MongodbServiceProvider->Jenssegers\Mongodb\{closure}(array('driver' => 'mongodb', 'host' => 'ds013004.mlab.com', 'port' => '13004', 'database' => 'laravel', 'username' => 'user', 'password' => 'user', 'options' => array('database' => 'laravel')), 'mongodb') at call_user_func(object(Closure), array('driver' => 'mongodb', 'host' => 'ds013004.mlab.com', 'port' => '13004', 'database' => 'laravel', 'username' => 'user', 'password' => 'user', 'options' => array('database' => 'laravel')), 'mongodb') in DatabaseManager.php line 164 at DatabaseManager->makeConnection('mongodb') in DatabaseManager.php line 68 at DatabaseManager->connection('mongodb') in Model.php line 3282 at Model::resolveConnection('mongodb') in Model.php line 3248 at Model->getConnection() in Model.php line 523 at Model->newBaseQueryBuilder() in Model.php line 1842 at Model->newQueryWithoutScopes() in Model.php line 1457 at Model->save() in MainController.php line 31 at MainController->postQuote(object(Request)) at call_user_func_array(array(object(MainController), 'postQuote'), array(object(Request))) in Controller.php line 80 at Controller->callAction('postQuote', array(object(Request))) in ControllerDispatcher.php line 146 at ControllerDispatcher->call(object(MainController), object(Route), 'postQuote') in ControllerDispatcher.php line 94

And..

Author::create(['user'=>'user name']);

results in

MassAssignmentException in Model.php line 445: user

My setup is a homestead vagrant setup on windows 7 x64. Php version 5.6.21, mongo.so version 1.1.7 and laravel 5.2.*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant