Saturday, October 19, 2013

The Response content must be a string or object implementing __toString(), "boolean" given. Laravel4

"The Response content must be a string or object implementing __toString(), "boolean" given. Laravel4" .

This kind of error will kill you if yo are going to debug it Or trace it step by step, you will never find the solution because this error happens in response, I mean that it will be detected by the framework only after the response is ready to be rendered ,So it is as the message said "the response is boolean". Often it will happen in the view that some variables affect the response content . Just check the view variables one by one ,and remove each of them the try to run again . you will find the variable that cause this error. But before going in this path try to change the view by any other view page (blade-template) and see if the error is still there . if it is not , then the problem in the view page.

Sometime this error caused by directly returning false :

 
return false ;
Just change it to :
return 0;

No comments:

Post a Comment