Support the ongoing development of →
Requests Eloquent Views
Last updated 9 months 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 9 months ago.

You can register route like this:

Route::get('/dependencies/{id}/inventories',['as' => '','uses' => 
'[email protected]']);

and in your showInventories controller action:

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

Last updated 9 months 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.

© 2023 - All rights reserved.