You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There must be something I am not understanding here.
I have a Submission model which is a mongo collection and it hasMany images which previously was also a mongo collection. I was using $submissions = Submission::has('images')->get(); and this was working fine, returning all submissions with at least one image.
Now I decided to convert my Image mongo collection to a mysql table and now it seems I can't use has() anymore
Submission.php
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
class Submission extends Eloquent
{
protected $connection = 'mongodb';
protected $collection = 'submissions';
public function images()
{
return $this->hasMany('\App\Models\Image', "submission_id");
}
}
Image.php
use Illuminate\Database\Eloquent\Model;
use Jenssegers\Mongodb\Eloquent\HybridRelations;
class Image extends Model
{
use HybridRelations;
protected $connection = 'default';
public $table = 'images';
public function submission()
{
return $this->belongsTo('\App\Models\Submission', "submission_id");
}
}
When I try to run my query I get
BadMethodCallException in Builder.php line 2508:
Call to undefined method Illuminate\Database\Query\Builder::getHasCompareKey()
Please someone help.. been trying to solve this for hours.
The text was updated successfully, but these errors were encountered:
There must be something I am not understanding here.
I have a Submission model which is a mongo collection and it hasMany images which previously was also a mongo collection. I was using $submissions = Submission::has('images')->get(); and this was working fine, returning all submissions with at least one image.
Now I decided to convert my Image mongo collection to a mysql table and now it seems I can't use has() anymore
Submission.php
Image.php
When I try to run my query I get
Please someone help.. been trying to solve this for hours.
The text was updated successfully, but these errors were encountered: