Trying to get property 'cost_item' of non-object

Posted 2 months ago by zaster


     $pos = PO::all();


 @foreach ($pos as $po)                      

dd($pos) shows all the collections with relations without any issue

but when i try to view this page. I am getting this error

Trying to get property 'cost_item' of non-object

Relationships are as below mentioned

po hasMany po_items

po_item belongsTo cost_item

cost_item belongsTo vendor_company

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.