i have three tables inventory,products,product_category
in table:inventory
id product_name quantity
1 2 24
2 2 54653
3 1 34
here product_name is foreign key..this table has many relation with product table
in table:products
id name type_fk_id
1 pc 1
2 laptop 2
3 servo_oil 2
here type_fk_id is foreign key..this table has many relation with product_category table
in table:product_category
id type_name
1 PC
2 oil
3 servo_oil
there is no foreign key in product_category table
in my controller
$data=Inventory::all();
return view('inv_view',compact('data'));
in inv_view view
@foreach($data as $inv)
{{$inv->id}}
{{$inv->qty}}
@endforeach
i want to show in the view part also product name and category thats mean
id quantity product_name category
1 34 pc pc
2 436 servo_oil oil
i don't know how to access or get this data in view using laravel eloquent relation
i know how to use hasmanyThrough in model to access product_category->product->inventory
...how can i use inverse of hasmanythrough thats mean inventory->product->product_category