Skip to content
Advertisement

htmlspecialchars() when print view

I get the error:

htmlspecialchars() expects parameter 1 to be string, object given

When print the view get the error, I don’t understand what is wrong in my code. I have print and object? How could solve it?

This is my controller:

JavaScript

This is my view:

JavaScript

This is my dd() print:

JavaScript

Advertisement

Answer

I changed the function to return a string only and not an object

Before:

JavaScript

Changed:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement