Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

If I speak in the tongues of mortals and of angels, but do not have love, I am a noisy gong or a clanging cymbal. And if I have prophetic powers, and understand all mysteries and all knowledge, and if I have all faith, so as to remove mountains, but do not have love, I am nothing. If I give away all my possessions, and if I hand over my body so that I may boast, but do not have love, I gain nothing.Love is patient; love is kind; love is not envious or boastful or arrogant or rude. It does not insist on its own way; it is not irritable or resentful; it does not rejoice in wrongdoing, but rejoices in the truth. It bears all things, believes all things, hopes all things, endures all things.

http://www.fifa16coinsmall.com

http://www.2maplestory.com/

http://www.rsgpfast.com

0

@jjrwin

try Crew::find(102)->events()->get();

0
Solution

I solved it this morning. It should be something like this

return $this->hasMany('App\Models\Scheduling\Event');
return $this->belongsTo('App\Models\Scheduling\Crew');

or alternatively, I had to switch the crew_id and id fields around

return $this->hasMany('App\Models\Scheduling\Event', 'crew_id', 'id');
return $this->belongsTo('App\Models\Scheduling\Crew', 'id', 'crew_id');
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jirwin jirwin Joined 4 Aug 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.