introduction to laravel

12
INTRODUCTION TO LARAVEL @vinlim [email protected] THE PHP FRAMEWORK FOR WEB ARTISANS

Upload: vin-lim

Post on 06-May-2015

824 views

Category:

Technology


8 download

DESCRIPTION

Introduction to Laravel. The PHP Framework for Web Artisans. Laravel is a free, open source PHP web application framework, designed for the development of MVC web applications. Laravel is released under the MIT license, with its source code hosted on GitHub.

TRANSCRIPT

Page 1: Introduction to Laravel

INTRODUCTION TO LARAVEL

@[email protected]

THE PHP FRAMEWORK FOR WEB ARTISANS

Page 2: Introduction to Laravel

NOTICE

THIS IS NOT A FRAMEWORK WAR

Page 3: Introduction to Laravel

The Usual About Me

• Self-taught HTML in 1997 (1st Book bought on MV Doulos)• Founded WebEvolution Resources in 2001• Decade in Sales (Banking & Pharmaceutical)• Founded yourfoodreview.com in 2010• Founded Green Room in 2013• Really into PHP after meeting other half

Page 4: Introduction to Laravel

Back to Laravel• Before there were light, there was CodeIgniter.

• CodeIgniter is probably the most popular framework back then, known for it’s ultra lightweight and simple learning curve.

• In 2011, Taylor Otwell the creator of Laravel decided that some essential functionalities are missing in CodeIgniter, like out-of-the-box authentication, closure routing & etc.

• Laravel 4 was released on May 2013, rewritten from ground up. It is now one of the, if not, the most powerful PHP framework. With advance functionality such as DB seeding, built-in mailer, blade templating and an even more powerful Eloquent ORM.

Love history? http://maxoffsky.com/code-blog/history-of-laravel-php-framework-eloquence-emerging

Page 5: Introduction to Laravel

Let’s Get Dirty

composer create-project laravel/laravel webcamppg

Quick Start

Creating project ‘webcamppg’ with composer

Page 6: Introduction to Laravel

Directory Structure

• public/ is everything accessible externally• app/ is your playground• app/controllers is the home of your controller • app/models is the home of your models• app/views is the home of your views

Page 7: Introduction to Laravel

Blade Templating

<?php $name = “Vin Lim”;

?>

@if (isset($name))Welcome {{$name}},

@elseWelcome Stranger

@endif

Echo Data

Echo PHP variable with If .. Else conditioning

Page 8: Introduction to Laravel

RESTful Routing

Route::get('/hello’ , function() { return 'Hello World';

});

Route::get(’/name/{name}’ , ’HomeController@showWelcome');

Route::post(’/’ , ’HomeController@showWelcome');

Echo Data

Echo PHP variable with If .. Else conditioning

Page 9: Introduction to Laravel

Requests & Input

public function showWelcome() {if (Input::has('name')) {

data[‘name’] = Input::get(‘name’);return View::make('hello')->with(‘data’,$data);

} else {return View::make('hello’);

}}

Basic Input

Check & retrieve an input value

Page 10: Introduction to Laravel

Other Resources

Laravel: Code BrightWeb application development for the Laravel framework version 4 for beginners.

Laravel DocumentationOfficial Documentation – laravel.com/docs/

Page 11: Introduction to Laravel

Oh and of course…

Stack Overflowwww.stackoverflow.com

Page 12: Introduction to Laravel

@[email protected]

THANK YOUA special thank to Laravel core team and it’s awesome commnity

for making our life, so much better.

github.com/laravel/laravel