Web and Server) I handle everything technical @ MotionDen & Utonexus. Co-Organizer, GDGBaroda. Third Year IT Engineering Student @ SVIT Vasad. https://curos.in
Developer Experience • Rapid Development • Modern and Adapting : Composer, Design Patterns, Modern Workflows • Standards : PHP-FIG and PSRs • Ecosystem
bower, pip) • Autoloading. • Using 3rd party PHP packages becomes a breeze. • Effectively uses PHP Namespaces to organize code. • https://getcomposer.org/
world • Leading frameworks have a representatives, and together they define standards for the PHP world, called PSRs : PHP Standards Recommendations • http://www.php-fig.org/
and SQL Server • SQL Query Builder • Uses PDO - PHP Data Objects • SQLi - safe : 1st Order & 2nd Order • Transactions, Joins, Ordering, Grouping, “Safe” Inserts and updates, Raw SQL
database, cache-based (redis) • Simple key value store and simple API : ◦ Session::get() Session::put() Session::flush() • “Safe” : Data is stored server side only, and if cookie driver is used, it is kept encrypted
• Services == Objects == Instances of a Class • IoC == Dependency Injection == Framework provides the service to us class MyController { private $db; public function __construct(Database $db) { $this->db = $db; } public function something() { //use $this->db instead of ‘DB::’} }
You, the user are not responsible for managing dependencies. • The framework provides you with whatever you need. • You need to first teach recipes to the framework. Then you can ask for whatever you want.
App::bind(‘Cheese’, function () { return new Cheese(); }); App::bind(‘Pizza’, function (Cheese $c) { return new Pizza($c); }); // later $pizza = App::make(‘Pizza’); // instead of $pizza = new Pizza(new Cheese());
for binding services into container • Each service has its own service provider • You can create your own services using ServiceProviders or, just add new services in the AppServiceProvider.
• Saves you from dependency hell. • SOLID : Single Responsibility Principle : Keep code simple • SOLID : Liskov Substitution Principle : Use contracts • SOLID : Interface Segregation Principle : Interfaces are better than concretes • Makes is easy to change drivers, or underlying implementations.
artisan (for console) • Laravel IoC Container created • HttpKernel or ConsoleKernel is retrieved • Both kernels run the service providers, services are created • Request object is created and passed on to the Kernel • Kernel dispatches to Router. Router routes, and returns.
- Developer Experience + Performance • Uses the same components as Laravel • Facades are not available by default • Authentication Bootstrapping code not available
: Really good video tutorials, but paid. https://mattstauffer.co/ : One of the best blogs on Laravel For help, https://larachat.co/ is the slack channel, you’ll find a lot of people availabe for help. Laravel Cashier, Socialite, Passport, Scout.