[PHPConf Taiwan 2015] 跟著 Laravel 5.1 一起成為更好的 PHP 開發者

  • Published on
    11-Apr-2017

  • View
    7.388

  • Download
    18

Embed Size (px)

Transcript

  • Laravel'5.1 PHP

    5.1

    PHPConf'Taiwan'2015

    2015/10/9

    'Shengyou'Fan

  • @shengyou http://shengyoufan.com https://www.facebook.com/shengyoufan

    Laravel Laravel Dojo

    http://shengyoufan.comhttps://www.facebook.com/shengyoufan

  • Questions/kws'tn/

    (Frequency)

    http://nos.twnsnd.co/image/108924593125

    http://nos.twnsnd.co/image/108924593125

  • PHPConf'Taiwan'2015

  • PHPConf'Taiwan'2015

    http://www.geocaching.com/geocache/GC5BJ10_the-matrix

  • PHPConf'Taiwan'2015

  • TL DR

    ;

  • PHPConf'Taiwan'2015

    http://w3techs.com/technologies/overview/programming_language/all

    (PHP ) PHP

  • PHPConf'Taiwan'2015

    http://matrix.wikia.com/wiki/Rescue_of_Morpheus

    ( ^.< )

  • PHPConf'Taiwan'2015

    (2015 )

    http://www.sitepoint.com/best-php-framework-2015-sitepoint-survey-results/

    Laravel

  • History/hs'tri/

    http://nos.twnsnd.co/image/101262858376

    http://nos.twnsnd.co/image/101262858376

  • PHPConf'Taiwan'2015

    ( )

    Laravel

    Aug. 2013 ~

    Laravel

    Symfony

    Phalcon

    Jun. 2013

    MVC

    Ruby on Rails

    ASP.NET MVC

    Node.js, Sails.js

    Python, Django

    Java, Play

    Feb. 2010

    Codeigniter

    MVC

    Oct. 2009

    Pure PHP

    .php

    ~ Mar. 2009

  • Why Laravel? Laravel

  • PHPConf'Taiwan'2015

    Laravel 5.1 Laravel 5.1

    - Feature - - Standard - - Workflow -

    - Ecosystem -

    (Language)

  • Feature/fi'tr/'

    (Language)

    https://www.flickr.com/

    https://www.flickr.com/photos/library_of_congress/8232905878/in/photolist-dxvN65-6j3Bmi-8avMRp-oufjFM-5SSk2K-fiTmzx-dM1Z7X-qmyWC6-8nS95Q-8aocjo-4i7p2v-dn9YBq-fiTYNe-6j3uJv-4i8WZ6-6j7yA3-fj8DeY-4ibwMY-fiTku6-fj8yyE-7DiudS-eXt7Fb-odWsRi-4i8WER-ovrP2F-fiTks2-fiTsb4-fiTkki-fiTkZ2-fj8x5f-eRF6ff-qwLeni-hRqVbW-oufmoK-6j3n6R-fiTD7M-fj8ypW-7DigT7-fiTkca-89ghWv-fiTZDi-fj9c85-fj9bV7-fiTxbV-fj8xT9-6v5bA6-fj9btb-yuCkQ3-6j7yS9-efLs7k

  • PHPConf'Taiwan'2015

    PHP 5.4 Sep. 2015 PHP

    PHP 5.5

    PHP http://php.net/supported-versions.php

    http://php.net/supported-versions.php

  • PHPConf'Taiwan'2015

    PHP - PHP 5.3 - Namespaces

    - PHP 5.4 - []TraitsBuilt-in web server- PHP 5.5 - Generators

    - PHP 5.6 - Variadic functions via phpdbg- PHP 7 - Performance++

  • PHPConf'Taiwan'2015

    ( )

    PHPUnit 5.0 https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-5.0.0

    PHPUnit https://twitter.com/JeroenDeDauw/status/649825871533109248

    PHPUnit 5.0 PHP 5.6

    https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-5.0.0https://twitter.com/JeroenDeDauw/status/649825871533109248

  • PHPConf'Taiwan'2015

    Laravel New PHP{'

    ''"name":'"laravel/laravel",'

    ''/*''*/'''"require":'{'

    ''''"php":'">=5.5.9",'

    ''''/*''*/'''},'

    ''/*''*/'}

    Laravel 5.1 composer.json

    http://laravel.com/docs/5.1/releases#laravel-5.1

    Homestead PHP 7

    http://laravel.com/docs/5.1/homestead#upgrading-to-php-7

    https://laravel-news.com/2015/10/homestead-now-with-php-7-support/

    http://laravel.com/docs/5.1/releases#laravel-5.1http://laravel.com/docs/5.1/homestead#upgrading-to-php-7https://laravel-news.com/2015/10/homestead-now-with-php-7-support/

  • PHPConf'Taiwan'2015

    Laravel PHP 5.3

    Laravel 5.0 Application Code Namespaces

  • PHPConf'Taiwan'2015

    Laravel PHP 5.4

    Laravel http://laravel.com/docs/5.1/eloquent#soft-deleting

    http://laravel.com/docs/5.1/eloquent#soft-deleting

  • PHPConf'Taiwan'2015

    Laravel PHP 5.5

    github https://github.com/laravel/laravel/blob/v5.0.22/config/app.php

    github https://github.com/laravel/laravel/blob/v5.1.11/config/app.php

    Laravel 5.0 providers Laravel 5.1 providers

    https://github.com/laravel/laravel/blob/v5.0.22/config/app.phphttps://github.com/laravel/laravel/blob/v5.1.11/config/app.php

  • PHPConf'Taiwan'2015

    Laravel Design Pattern MVC (Model - View - Controller)

    Dependency Injection

    IoC (Inverse of Control) Container

    Yish https://laraveltw.hackpad.com/PHP-rDP6MbkvsH7

  • PHPConf'Taiwan'2015

    PHP 5.5.9 - PHP 5.3 - Namespaces

    - PHP 5.4 - TraitSquare bracket array syntax- PHP 5.5 - Class name resolution via ::class

    Design Pattern - MVC

    - Dependency Injection

    - IoC Container

  • Feature'Laravel' 'PHP

    (Language)

    https://www.flickr.com/

    https://www.flickr.com/photos/library_of_congress/8232905878/in/photolist-dxvN65-6j3Bmi-8avMRp-oufjFM-5SSk2K-fiTmzx-dM1Z7X-qmyWC6-8nS95Q-8aocjo-4i7p2v-dn9YBq-fiTYNe-6j3uJv-4i8WZ6-6j7yA3-fj8DeY-4ibwMY-fiTku6-fj8yyE-7DiudS-eXt7Fb-odWsRi-4i8WER-ovrP2F-fiTks2-fiTsb4-fiTkki-fiTkZ2-fj8x5f-eRF6ff-qwLeni-hRqVbW-oufmoK-6j3n6R-fiTD7M-fj8ypW-7DigT7-fiTkca-89ghWv-fiTZDi-fj9c85-fj9bV7-fiTxbV-fj8xT9-6v5bA6-fj9btb-yuCkQ3-6j7yS9-efLs7k

  • Standard/stn'drd/'

    http://nos.twnsnd.co/image/96545399188

    http://nos.twnsnd.co/image/96545399188

  • PHPConf'Taiwan'2015

    Laravel Illuminate PHP 2009

    php|tek PHP-FIG PHP

    Laravel PHP-FIG Illuminate Starter Package

    Composer

    $'composer'create[project'laravel/laravel'[[prefer[dist

    ( Composer Laravel skeleton)

  • PHPConf'Taiwan'2015

    Laravel Autoload

    {'

    ''''"name":'"laravel/laravel",'

    ''''/*''*/'''''"autoload":'{'

    ''''''''"classmap":'['

    ''''''''''''"database"'

    ''''''''],'

    ''''''''"psr[4":'{'

    ''''''''''''"App\\":'"app/"'

    ''''''''}'

    ''''},'

    ''''/*''*/'}

    Laravel 5.1 composer.json

  • PHPConf'Taiwan'2015

    Laravel Style Guide - PHP

    Laravel - Laravel 4 PSR-1 - Laravel 5.1 PSR-2

    http://laravel.com/docs/5.1/contributions#coding-style

    http://laravel.com/docs/5.1/contributions#coding-style

  • PHPConf'Taiwan'2015

    Coding Style

    - squizlabs/php_codesniffer

    - fabpot/php-cs-fixer

    http://oomusou.io/2015/09/23/php-coding-standard/

  • PHPConf'Taiwan'2015

    Illuminate (Laravel 4.0)

    PSR-4 Autoload (Laravel 5.0)

    PSR - 1 (Laravel 4.2) PSR - 2 (Laravel 5.1)

    (Symfony Component)

    (Laravel 4.2 PSR-0 Autoload PSR-0 )

  • Standard

    http://nos.twnsnd.co/image/96545399188

    http://nos.twnsnd.co/image/96545399188

  • Workflow/wrkflo/

    https://www.flickr.com/

    https://www.flickr.com/photos/twm_news/17285322262/in/photolist-skrN6C-ouaHKh-owucW5-oeAETY-ouLVUp-tMG6b3-ocEaKo-ow2yuH-oePNH8-ow6B69-oeNMky-oeNXnM-rdpY4u-8DvHsC-nN47bZ-ovVvAt-8nRSaN-owoDgf-owu7hj-odj81D-owpzjL-fqoP1F-ovc1xc-odh7aL-89fLZi-oeWr8v-of2jni-odjTpM-oeN4U5-outZxo-owu2NQ-ouqHTy-oeQG72-obZaDP-ovKFYA-owgvJA-oc26nE-ourawh-ougBGo-oueHbH-oeN5xm-oet7BZ-oyb4cX-ocSp4U-oupJyo-own2Mm-osnXhA-owucTT-owktps-ourr5

  • PHPConf'Taiwan'2015

    PHP

  • PHPConf'Taiwan'2015

    Mac Windows Linux

  • PHPConf'Taiwan'2015

    Laravel VMs

    Mac Windows Linux

    Homestead Homestead Homestead

  • PHPConf'Taiwan'2015

    Composer create[project A B - MUST- -

    API

  • PHPConf'Taiwan'2015

    Laravel Composer Laravel Package

    - laravel/installer

    - laravel/socialite

    - laravel/cashier

    - laravel/spark-installer (alpha)

    - laravel/lumen

  • PHPConf'Taiwan'2015

    - BootstrapFont AwesomejQuery- CSS LESSSASS- JS CoffeeScriptTypeScriptES6- - Cache

    PHP

  • PHPConf'Taiwan'2015

    Laravel Elixir

    Elixir

    gulpfile.js

    var'elixir'='require('laravel[elixir');'

    elixir(function(mix)'{'

    ''''mix.functions();'

    });

    package.json

    {'

    ''''"private":'true,'

    ''''"devDependencies":'{'

    ''''''"gulp":'"^3.8.8"'

    ''''},'

    ''''"dependencies":'{'

    ''''''"laravel[elixir":'"^3.0.0",'

    ''''''"bootstrap[sass":'"^3.0.0"'

    ''''}'

    }

    Assets

  • PHPConf'Taiwan'2015

    - Unit Testing

    - Functional Testing

    - Acceptance Testing

    - TDD

    - BDD

  • PHPConf'Taiwan'2015

    Laravel Testing{'

    ''''"name":'"laravel/laravel",'

    ' "require[dev":'{'

    ' ' "fzaninotto/faker":'"~1.4",'

    ' ' "mockery/mockery":'"0.9.*",'

    ' ' "phpunit/phpunit":'"~4.0",'

    ' ' "phpspec/phpspec":'"~2.1"'

    ' },'

    '''/*''*/'}

    Laravel 5.1 composer.json

    var'elixir'='require('laravel[elixir');'

    elixir(function(mix)'{'

    ''''mix.phpUnit();'

    });

    Laravel 5.1 gulpfile.js

    $'gulp'tdd

    public'function'testTddExample()'

    {'

    '''/*' '*/'}

  • PHPConf'Taiwan'2015

    Laravel Homestead $ gulp tdd http://oomusou.io/2015/09/27/tdd-gulp-homestead/

    $ gulp tdd http://yish.im/2015/09/24/AutoTest-in-PHP/

    http://oomusou.io/2015/09/20/tdd-jaceju/ http://blog.winwu.today/2015/09/php-tdd.html https://goo.gl/ejELDG http://chan15.blogspot.tw/2015/09/php-mockery.html https://goo.gl/unrA2X http://yish.im/2015/09/24/AutoTest-in-PHP/ http://blog.tinymao.com/2015/09/24/php-tdd/

  • PHPConf'Taiwan'2015

    /

    gitComposerGulp

    DevOps http://www.slideshare.net/warfan/devops-53161280

  • PHPConf'Taiwan'2015

    Laravel Automation

    Local

    $'envoy'run'deploy

    Server'3Server'1 Server'2

    Cloud'Servers

    @servers(['web''=>''192.168.1.1'])'

    @task('deploy','['on''=>''web'])'

    ''''cd'site'

    ''''git'pull'origin'{{'$branch'}}'

    ''''php'artisan'migrate'

    @endtask

    Envoy.blade.php

  • PHPConf'Taiwan'2015

    $'gulp'tdd

    $'envoy'run

  • PHPConf'Taiwan'2015 - iNDIEVOX

  • Workflow

    https://www.flickr.com/

    https://www.flickr.com/photos/twm_news/17285322262/in/photolist-skrN6C-ouaHKh-owucW5-oeAETY-ouLVUp-tMG6b3-ocEaKo-ow2yuH-oePNH8-ow6B69-oeNMky-oeNXnM-rdpY4u-8DvHsC-nN47bZ-ovVvAt-8nRSaN-owoDgf-owu7hj-odj81D-owpzjL-fqoP1F-ovc1xc-odh7aL-89fLZi-oeWr8v-of2jni-odjTpM-oeN4U5-outZxo-owu2NQ-ouqHTy-oeQG72-obZaDP-ovKFYA-owgvJA-oc26nE-ourawh-ougBGo-oueHbH-oeN5xm-oet7BZ-oyb4cX-ocSp4U-oupJyo-own2Mm-osnXhA-owucTT-owktps-ourr5

  • Ecosystem/k'oss'tm'/

    http://picography.co/photos/dark-forest/

    http://picography.co/photos/dark-forest/

  • - rails

  • PHPConf'Taiwan'2015

    ( API ) LTS (5.1 Laravel LTS) (homestead, forge, envoyer) (socialite, casher, spark, lumen) (laravel.io)

    Podcast (The Laravel Podcast)

    (laracast.com) Laracon USLaracon EU

    http://laravel.io/forumhttp://www.laravelpodcast.com/http://laracast.com

  • PHPConf'Taiwan'2015 http://packalyst.com/

    http://packalyst.com/

  • PHPConf'Taiwan'2015 Socialite http://socialiteproviders.github.io/

    http://socialiteproviders.github.io/

  • Laravel Laravel Framework

    https://goo.gl/h2m5Tq'

    Guys!'We'did'a'great'job!

    https://goo.gl/h2m5Tq

  • PHPConf'Taiwan'2015 https://www.facebook.com/groups/laravel.tw/

    Facebook

    https://www.facebook.com/groups/laravel.tw/

  • PHPConf'Taiwan'2015

    Laravel

    http://laravel.tw/

    http://laravel.tw/

  • PHPConf'Taiwan'2015

    PHP Slack

    https://phptw.slack.com/ http://join-slack.phptw.org/

    https://phptw.slack.com/http://join-slack.phptw.org/

  • 2015 COSCUP WorkshopLaravel Installfest

  • TDD/BDD Laravel 2015 9 TDD/BDD 25 PHP TDD BDD

  • 2015/09/19 - 20

  • 2015/09/19 - 20

  • PHPConf'Taiwan'2015

    10 Laravel - 2015/10/25 ( ) PM 1:00 ~ 5:00- Dreamseeds

    - - Laravel Tracy -

    Recca Tsai

    ( 262 )

  • PHP Day PHP

    https://goo.gl/rzEFuE'

    Ricky!'We'love'you~

    https://goo.gl/rzEFuE

  • PHP Day #19 PHP

  • LaradinerPHP/Laravel PHP/Laravel

    https://goo.gl/AmiWG7

    Sam,'you'are'awesome!

    https://goo.gl/AmiWG7

  • Laradiner #15 From Apprentice To Artisan

  • PHPConf'Taiwan'2015

    Modern PHP (Laradiner )

    https://goo.gl/LUc2IG'

    hackpad

    https://goo.gl/LUc2IG

  • PHPConf'Taiwan'2015

    From Apprentice To Artisan

    (Laradiner )

    https://goo.gl/FF9Qbc'

    Facebook Events

    https://goo.gl/FF9Qbc

  • PHPConf'Taiwan'2015

    Laravel

    http://www.laravel-dojo.com/

    http://www.laravel-dojo.com/

  • PHPConf'Taiwan'2015

    http://www.laravel-dojo.com/opensource/wagon

    wagon - Laravel

    http://www.laravel-dojo.com/opensource/wagon

  • PHPConf'Taiwan'2015 http://www.laravel-dojo.com/showcases

    http://www.laravel-dojo.com/showcases

  • PHPConf'Taiwan'2015

    Laravel 2014/12 2015/05 2015/07

    http://www.laravel-dojo.com/workshops

    http://www.laravel-dojo.com/workshops

  • PHPConf'Taiwan'2015

    11/14 Laravel

    http://class.ithome.com.tw/laravel/

    http://class.ithome.com.tw/laravel/

  • PHPConf'Taiwan'2015

    Laravel YouLaravel

    PHP Slack

    Laravel

  • Ecosystem

    http://picography.co/photos/dark-forest/

    http://picography.co/photos/dark-forest/

  • Conclusions/knklu'n/

    (Recap)

  • PHPConf'Taiwan'2015

    Laravel (5.1) - - - -

  • Laravel 5.1

  • PHPConf'Taiwan'2015

    From apprentice to artisan

    http://www.theforce.net

    http://www.theforce.net/latestnews/story/you_can_make_the_jump_to_hyperspace_in_dallas_98220.asp

  • and become an artisanCode Happy!

  • PHPConf'Taiwan'2015

    Q & A

Recommended

View more >