Support the ongoing development of →
Requests Eloquent Views
Last updated 1 year ago.

I think the correct syntax is

$model = Dependences::find(25)->has('inventories')->get();

foreach ($model as $row) $row->dependences->inventories

I may be off on the exact syntax

Last updated 1 year ago.

You can register route like this:

Route::get('/dependencies/{id}/inventories',['as' => '','uses' => 

and in your showInventories controller action:

public function showInventories($id)
	$dep = Dependence::find($id)
	$inventories = $dep->inventories;
	//return response etc

Last updated 1 year ago.

Sign in to participate in this thread!


Your banner here too?

cfgv cfgv Joined 26 Feb 2014


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

Your logo here?

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

© 2024 - All rights reserved.