THE PHP FRAMEWORK FOR WEB ARTISANS
What is Laravel? Developed by Taylor Otwell Web application framework Follows MVC design pattern Expressive syntax
Why use Laravel Elegant syntax Utilizes the latest PHP features Well documented CLI Tools Eloquent ORM Fun to develop with
Closures Introduced in PHP 5.3 Anonymous functions Route::get(‘login’, function() { return View::make(‘users/login’); });
The Syntactic Sugar Easy to understand Expressiveness and elegance Auth::check() Input::get() User::all()
The MVC Layers Eloquent ORM Blade Engine Controller
Eloquent ORM Easy to use class Feed extends Eloquent { public function user() { return $this->belongsTo('User'); } public function moment() { return $this->created_at->diffForHumans(); }
Eloquent ORM Example queries: Book::all() Book::find(1) Book::where(‘name’, ‘=‘, ‘John Doe’) Insert / Update $b = new Book(); $b->title = ‘Intro to Laravel’; $b->description = ‘This book rocks’; $b->save; $b = Book::find(2); $b->title = ‘Advanced Laravel’; $b->save();
Eloquent ORM Relationship mapping public function user() { return $this->belongsTo(‘Author’, ‘authro_id’); {
Blade Engine Stock templating engine for laravel Supports template inheritance and Some
title’, ‘Test Hello
Bootstrap The most popular front-end framework for developing responsive, mobile first projects on the web.