Your $model variable shouldn't be an stdClass instance. It should be a Post instance. (or anything with the Likes trait).
$model
stdClass
Post
Likes
I suggest you dump this variable with dd($model) in the controller before returning the view and try to understand what's going on.
dd($model)
Good luck!
I've tried it, it's still an error in the Undefined property: stdClass::$likes
and already using dd()
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Your
$model
variable shouldn't be anstdClass
instance. It should be aPost
instance. (or anything with theLikes
trait).I suggest you dump this variable with
dd($model)
in the controller before returning the view and try to understand what's going on.Good luck!
I've tried it, it's still an error in the
Undefined property: stdClass::$likes
and already using dd()