This is a valid hasManyThrough relationship.
To get the garage you can do
security->car->garage;
or add a shortcut in the model
class Securities extends Eloquent
{
public function cars()
{
return $this->hasOne('cars');
}
public function garage()
{
return $this->car->garage;
}
}
when eager loading (do it) make this
Security::with('car', 'car.garage')->...->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community