I have this error with moloquent/moloquent package.
composer require moloquent/moloquent
My Item class Model extended from Moloquent:
<?php
namespace App;
use Moloquent\Eloquent\Model as Eloquent;
class Item extends Eloquent
{
protected $collection = 'items';
protected $connection = 'mongodb';
...
}
My test to insert into items collection:
Item::create([
'user_id' => 1,
'title' => 'test',
'slug' => 'test',
])
Result:
FatalThrowableError in Builder.php line 103: Type error: Argument 1 passed to Moloquent\Query\Builder::__construct() must be an instance of Moloquent\Connection, instance of Illuminate\Database\MySqlConnection given, called in /home/site_com/http/www/vendor/moloquent/moloquent/src/Eloquent/Model.php on line 560
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community