Using dependency injection over laravel facades

This is one of the benefits of constructor injection – it becomes obvious when you class is doing to much, because the constructor parameters grow too large. 1st thing to do is split up controllers that have too many responsibilities. Say you have a page controller: Class PageController { public function __construct( Request $request, ClientRepositoryInterface … Read more

Undefined class Route (Laravel in PhpStorm)

Check the Laracasts walkthrough 1) Go to: https://github.com/barryvdh/laravel-ide-helper 2) Click on the gist Generated version for L5: https://gist.github.com/barryvdh/5227822 3) Click on “Raw” to get the current version (as of June 22, 2016 it is): https://gist.githubusercontent.com/barryvdh/5227822/raw/4d4b0ca26055fa4753b38edeb94fad2396c497c0/_ide_helper.php 4) Make sure you’re in your root directory (this is mine) cd /var/www/html/project 5) Download the gist: wget https://gist.githubusercontent.com/barryvdh/5227822/raw/4d4b0ca26055fa4753b38edeb94fad2396c497c0/_ide_helper.php 6) … Read more