22
Laravel? WTF is that?

Intro to Laravel

Embed Size (px)

Citation preview

Laravel? WTF is that?

Shameless Plug

Gibson TangFounder of Azukisoft

Pte Ltd

What is Laravel?

MVC framework With Dependency Injection Focus on Unit Tests DRY principles

Introduction

Currently at version 5.0 Version 4.2 is still popular 5.1 will be coming soon

Laravel

Based on Symfony Symfony has a higher learning curve Laravel has the opposite http://www.sitepoint.com/best-php-framework-2015-sitepoint-survey-results/

Laravel

Laravel

Uses Composer as a package manager Not Pear As Pear sucks You can't have a MVC framework without a package manager, can you?

Laravel

In a nutshell, as my friend said it 'It is like Rails for PHP'

This sounds like heresy to all the Rails people here

Well, everyone has their own opinion

Laravel

Coming from a CodeIgniter background Laravel makes it easy for you to focus on the business logic

As the other boilerplate stuff is abstracted away

Laravel

In the database.php file, you just need to fill in these parameters

'mysql' => array( 'driver' => 'mysql', 'host' => '127.0.0.1', 'database' => 'wordpress', 'port' => '3306', 'username' => 'root', 'password' => 'foobar123', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ),

Laravel

Laravel also abstracts away the syntax using ORMs and Query Builders

Has build in protection against SQL injections Eloquent Fluent

Laravel

Eloquent ORM $result = Customer::where('name', '=' 'Handsome')->get();

Instead of

Select * from Customer where name = 'Handsome';

Laravel

Fluent Query Builder $result = DB::table('customer')->where('id', 4)->get();

Instead of

Select * from Customer where id = 4';

Laravel

Database Migration Think of it as git for your database Except without the confusing and fun bits Easy seeding of database tables

Laravel

RESTful Controllers (Good for creating RESTful APIs)

Queue management In-house support for Redis Inhouse support for payment APIs using the Laravel Cashier package which interfaces with Stripe

Laravelhttps://github.com/search?l=PHP&q=+stars%3A%3E0&ref=searchresults&type=Repositories

Laravel

A lot of resources http://www.Laracasts.com http://www.packalyst.com for Laravel packages

http://laravel-recipes.com/ Among others

Laravel

Laravel sounds like the best thing that happened since sliced bread

So what's the downside?

Laravel

What's wrong? It's still using PHP Composer can be a memory hog when you run 'composer update'

Can be too heavyweight for some use cases

Laravel

No build in admin panel But there is a package for that Not as established as Python/Django or RoR But that means that Laravel has a lot of cool stuff coming it's way

Laravel For a lightweight framework Check out Lumen lumen.laravel.com Created by the same guy aka OMO(One Man Operation) who developed Laravel

It integrates well with Laravel

Laravel

Thank you. Any questions?