Trying to get property of non-object

Posted 3 months ago by screwtape_mk

I have a collection

$bookingPayments

can be seen here

Collection {#199 ▼
  #items: array:2 [▼
    0 => UserPayments {#202 ▶}
    1 => UserPayments {#203 ▶}
  ]
}

It gets passed on to a view; which returns an error in the following expression in the view:

$bookingPayments->first()->employee_id

Not sure what could be the problem

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