$30 off During Our Annual Pro Sale. View Details »

What's New In Laravel 5.3

What's New In Laravel 5.3

Chris Wilson will cover the shiny new features coming out in Laravel v5.3.

Chris Wilson

August 08, 2016
Tweet

More Decks by Chris Wilson

Other Decks in Programming

Transcript

  1. View Slide

  2. W H AT ' S N E W I N
    L A R AVE L 5 . 3
    A T A L K B Y C H R I S W I L S O N

    View Slide

  3. P re s t o
    @ C S W A P P S

    View Slide

  4. S C O U T

    View Slide

  5. S C O U T
    Laravel Scout is a driver based advanced Eloquent
    search, it supports Algolia out of the box.

    View Slide

  6. M A I L A B L E

    View Slide

  7. M A I L A B L E
    The new email class for sending emails
    in an intuitive and expressive way.

    View Slide

  8. N O T I F I C AT I O N S

    View Slide

  9. N O T I F I C AT I O N S
    The new notifications class allow you to make quick
    updates through services like Slack, SMS, or Email.

    View Slide

  10. PA S S P O RT

    View Slide

  11. PA S S P O RT
    API authentication is complex and difficult to
    implement, but Laravel Passport makes installing
    and setting up OAuth 2 a cinch.

    View Slide

  12. PA S S P O RT
    N O R E A L LY
    I T ’ S AW E S O M E !

    View Slide

  13. R O L L B A C K

    View Slide

  14. R O L L B A C K O N E M I G R AT I O N
    Rollback one allows you to rollback just one
    migration instead of the whole batch.

    View Slide

  15. B L A D E
    F O R E A C H
    L O O P S

    View Slide

  16. B L A D E F O R E A C H L O O P S
    Inside of a Blade file's foreach loop, you
    can now have new $loop variables.

    View Slide

  17. B L A D E F O R E A C H L O O P S
    Probably a better way of doing it would
    to do something like this.

    View Slide

  18. R E T U R N
    C O L L E C T I O N
    A

    View Slide

  19. R E T U R N A C O L L E C T I O N
    Query builder now returns a collection
    instead of an array.

    View Slide

  20. N E W J S O N
    C O L U M N S Y N T A X

    View Slide

  21. N E W J S O N C O L U M N S Y N T A X
    While Laravel has had the ability to cast your
    data to and from JSON since version 5.0, it was
    previously just a convenience—your data was
    still just stored in a TEXT field. But MySQL
    5.7 introduced an actual JSON column type.

    View Slide

  22. N E W J S O N C O L U M N S Y N T A X
    For example, lets say we have a players
    schema with a meta column.

    View Slide

  23. N E W J S O N C O L U M N S Y N T A X
    Our collection would look something like this.

    View Slide

  24. N E W J S O N C O L U M N S Y N T A X
    If we wanted to get all online players we
    could do something like this.

    View Slide

  25. N E W J S O N C O L U M N S Y N T A X
    If we wanted to update our player status,
    we could do something like this.

    View Slide

  26. R O U T I N G

    View Slide

  27. R O U T I N G C H A N G E S I N 5 . 3
    The routes.php file has been replaced with
    two new (web.php and api.php) files.
    Both of these files are now in the routes
    folder in the project’s root directory.

    View Slide

  28. D I R E C TO RY
    S T R U C T U R E C H A N G E S

    View Slide

  29. D I R E C TO RY S T R U C T U R E C H A N G E S
    With new Laravel 5.3 installs there are
    4 directories that will no longer be included
    out of the box that where prior to 5.3
    Events, Jobs, Listeners, and Policies
    These directories will automatically get
    added when they are needed by the frame
    work when an event, job, etc. is created.

    View Slide

  30. M U LT I P L E
    M I G R AT I O N PAT H S

    View Slide

  31. M U LT I P L E M I G R AT I O N PAT H S
    If you have ever installed a Laravel package
    that needs a migration, it involves copying it’s
    migrations into the migration folder, but with
    Laravel 5.3 - a package can define its
    own migration path.

    View Slide

  32. M U LT I P L E M I G R AT I O N PAT H S
    When you run
    php artisan migrate
    All migrations will run without you having
    to clutter your migration directory.

    View Slide

  33. And they coded happily ever after.
    T H E E N D

    View Slide