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;

Thursday, October 3, 2013

How to Exclude Folders From Git Gui on Windows

On the main Folder of your project create new file and name it .gitignore, This file will be read by git gui every time and all statemens will taken in account for Not tracking files or folders.

If you want to exclude a folder called "bin" , write a new line in this file "gitignore" like this:

bin/

here the bin folder located in the main folder will be excluded, if the folder you want to exclude is a subfolder,then you need to write :

bin/subfolder/

Ok, after that you have to order Git to remove cached file and remember what you have done here.
from the command line "cmd.exe" , write the following:

c:\project\git rm -r --cached .

//Don't forget the dot in the end of the command line.

then : run the following command:

c:\project\ git add .


Now any chenges made to the folder you specified in gitignore file will not be tracked.