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

Very poor solution:

$arr = array();

foreach($this->get(array('team2')) as $t) {
	$arr[] += $t->getAttributeValue('team2');
}

return $this->hasMany('Team', 'id', 'team1')->orWhereIn('teams.id', $arr);
Last updated 2 years ago.
0

eloquent relations return Relation type object. They are specific things.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Sejntcior sejntcior Joined 3 Aug 2014

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.