Home Laravel initiation of varible in __construct() VS while defining
 I was generally using Laravel __construct() function in Controllers to initialize some parameters. But when I trying to call method via AJAX request, protected variables seem to be not defined in method. I.e. protected $imageWidth; public function __construct(){$this->imageWidth=500; }  But when I initialize protected variable, while defining it, it solves my problem. protected \$imageWidth=500;  So, what is the difference between these 2 initializations and which should I use in which cases? Thanks...