what's new in laravel 5 (laravel meetup - 23th apr 15, yogyakarta, id)

40
What’s New in Laravel 5 An Introduction to Laravel 5 by Roes Wibowo Supported By

Upload: reyz-taksempurna

Post on 15-Jul-2015

265 views

Category:

Technology


2 download

TRANSCRIPT

What’s New in Laravel 5

An Introduction to Laravel 5

by Roes Wibowo

Supported By

About Laravel

- Fullstack PHP Web Framework

- Open Source (MIT License)

Version:

- v1, June 2011

- v2, November 2011

- v3, February 2012

- v4, May 2013

- v5 (4.3), February 2015

About Laravel

In Narnia (The Chronicles of Narnia), Cair Paravel is the

name of the castle where the kings and queens of Narnia

live. Laravel rhymes with Paravel. I thought the name had a

classy and sophisticated ring to it.

– Taylor Otwell

source: https://laravel-news.com/2014/03/in-narnia-cair-paravel-is-the-name-of-the-castle

About Laravel

Server Requirements:

- PHP >= 5.4

- Mcrypt PHP Extension

- OpenSSL PHP Extension

- Mbstring PHP Extension

- Tokenizer PHP Extension

- JSON PHP Extension

Why should we use Laravel?

Laravel powered by Composer,

tool dependency management and

autoloader for PHP.

https://packagist.orgmain composer repository.

http://packalyst.comdirectory of packages for Laravel.

Why should we use Laravel?

Laravel not just be trend, but future (of PHP Framework)!

Why should we use Laravel?

- Laravel is clean, classy and elegant PHP Framework

- Dependency Injection (DI) for reusable code

- Built in unit testing for TDD approach

- Follows PSR (L5 follow PSR-4)

- Use latest technology of PHP language

- Good documentation

- Great Community

Installing Laravel 5

- Using composer create-project

- Using laravel installer

Installing Laravel 5

- Download or clone via github then install using composer

Updating Laravel 5

- Update using composer

- Generate autoload composer

Removed Features in Laravel 5

- Annotation (Route,

Controller, Event, Model)

- Remote SSH

- HTML Form

- Whoops error handler

New Features in Laravel 5

- Artisan command

- Helpers

- Eloquent attribute casting

- Event object

- Event scheduler

- Form request & request validation

- Elixir

- Socialite

- Command (queue)

New Features in Laravel 5

- Folder structure

- DotEnv

- Cache route & config

- Symfony var dumper

- Middleware

- Contract

- Controller method injection

- Blade changes

- PsySH in Tinker

- Flysystem / Cloud Storage

Laravel 5 Folder Structure

Laravel 5 Folder Structure

DotEnv Configuration in Laravel 5

Catch environment variables from server configuration

DotEnv Configuration in Laravel 5

DotEnv Configuration in Laravel 5

DotEnv Configuration in Laravel 5

Symfony VarDumper in Laravel 5

The VarDumper component provides mechanisms for

walking through any arbitrary PHP variable

Cache Config and Route in Laravel 5

- Create and delete cache config

- Create and delete cache route

Cache Config and Route in Laravel 5

Cache route only for non Closure.

Cache location:

- /vendor/file.php, or

- /storage/framework/file.php

Middleware in Laravel 5

Middleware replace position Filter (L4)

- Generate Middleware:

Middleware in Laravel 5

- Before Middleware, perform some task before the

request is handled by the application

Middleware in Laravel 5

- After Middleware, perform some task after the request

is handled by the application

Middleware in Laravel 5

- Register Before/After Middleware:

Middleware in Laravel 5

- Terminable Middleware, perform some task after the

HTTP response has already been sent to the browser

Middleware in Laravel 5

- Register Terminable Middleware:

Middleware Route in Laravel 5

- Defining Middleware in Route:

Contract in Laravel 5

Controller Method Injection in Laravel 5

Blade changes in Laravel 5

PsySH in Laravel 5 tinker

Flysystem / Cloud Storage in Laravel 5

The Laravel Flysystem integration provides simple to use

drivers for working with local filesystems, Amazon S3, and

Rackspace Cloud Storage.

Flysystem / Cloud Storage in Laravel 5

Flysystem / Cloud Storage in Laravel 5

- Sample Route

- Check connection to AWS S3

Flysystem / Cloud Storage in Laravel 5

- Upload file from local storage

- Check file in storage

Flysystem / Cloud Storage in Laravel 5

- Edit it locally and upload it to cloud storage

Flysystem / Cloud Storage in Laravel 5

- Delete file

Discuss Session

Lets discuss about Laravel 5!