We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm not sure this part is working properly.
Just trying to do some relationship but I'm getting a null on my requests.
I have a "passengers" collection with a trip_id. Something like this:
{ "_id":"5d680fd36882d19e782d67bd", "trip_id":"5d680fcb6882d19e782d6380", "name":"Lee Jones" }
And a collection with the name "lotes" that contain documents that each one has many trips. Something like this:
{ "_id":"5d680fca6882d19e782d60f6", "user_id":"5d680fca6882d19e782d60b4", "date_to_ride":"2019-08-29T22:00:00.000+00:00", "trips":[ { "trip_id":"5d680fcb6882d19e782d6380", "car":"VW Golf" } ] }
So I want to get all passengers that has same trip_id when I'm getting the trip info.
This is my relation on the Trip model:
public function passengers() { return $this->hasMany(\App\Passenger::class, 'trip_id', 'trips.trip_id')->whereNotNull('trip_id'); }
My result? "passengers": []
The text was updated successfully, but these errors were encountered:
You can join to slack community and ask there
Sorry, something went wrong.
And describe full code for eloquent models
No branches or pull requests
I'm not sure this part is working properly.
Just trying to do some relationship but I'm getting a null on my requests.
I have a "passengers" collection with a trip_id. Something like this:
And a collection with the name "lotes" that contain documents that each one has many trips. Something like this:
So I want to get all passengers that has same trip_id when I'm getting the trip info.
This is my relation on the Trip model:
My result? "passengers": []
The text was updated successfully, but these errors were encountered: