introduction to laravel
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
NOTICE
THIS IS NOT A FRAMEWORK WAR
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
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
Let’s Get Dirty
composer create-project laravel/laravel webcamppg
Quick Start
Creating project ‘webcamppg’ with composer
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
Blade Templating
<?php $name = “Vin Lim”;
?>
@if (isset($name))Welcome {{$name}},
@elseWelcome Stranger
@endif
Echo Data
Echo PHP variable with If .. Else conditioning
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
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
Other Resources
Laravel: Code BrightWeb application development for the Laravel framework version 4 for beginners.
Laravel DocumentationOfficial Documentation – laravel.com/docs/
Oh and of course…
Stack Overflowwww.stackoverflow.com
THANK YOUA special thank to Laravel core team and it’s awesome commnity
for making our life, so much better.
github.com/laravel/laravel