Mais conteúdo relacionado Semelhante a A introduction to Laravel framework (20) A introduction to Laravel framework1. A INTRODUCTION TO
LARAVEL FRAMEWORK
DevZone@MegaAds.vn
Phult.contact@gmail.com, phamanhtuan206@gmail.com
Hanoi. Jan 09, 2016
2. CONTENT
About MegaAds Technical Team
Laravel Framework Overview
Laravel v4
Laravel v5
MegaAds & Laravel
3. MEGAADS TECHNICAL TEAM
Business
Coupon Affiliate in US
Retailer in Vietnam
Systems
Coupon affiliate websites
Link Crawler, Link Management
Retail websites
Order management
Inventory management
CRM
Tracker
SEO supplier system
4. MEGAADS TECHNICAL TEAM
Solutions
PHP, AngularJS, Laravel Framework
Java, Spring Framework
NodeJS, Adu Framework: https://github.com/phult/adu
Search engine: Elasticsearch
Message queue: Gearman
Database: MySQL, Redis
5. LARAVEL OVERVIEW
Developer: Taylor Otwell
Release: June 2011
Stable Release: 5.2.7, Dec 31, 2015
PHP: 5.3
Docs: http://laravel.com/docs, https://laracasts.com/
9. LARAVEL 4
Composer
Artisan CLI
Folder structure
Main classes
Blade template
Databases
ORM
Validation
Cache
Event
Queue
IoC
10. COMPOSER
A tool for dependency management in PHP. It allows you to declare the
libraries your project depends on and it will manage (install/update)
them for you
PHP: 5.3.2+
Equivalent:
Java: maven, gradle
Ruby: gem
Nodejs: npm
14. PROJECT FOLDER STRUCTURE
App
Config
Controllers
Database
Lang
Models
Start
Storage
Tests
Views
Bootstrap
Public
vendor
15. MAIN CLASSES
Config
App.php: debug, timezone, providers
Cache.php: drivers file/redis/mecache/apc/array
Database.php: connections, driver mysql/redis/mongo…
Mail.php
Queue: driver sync/beanstalkd/sqs/iron/redis
Session.php: drivers file/cookie/database/redis/mecache/apc/array
View.php: 'paths' => array(__DIR__.'/../views'),
26. MODEL/ORM
Get:
$user = User::find(1);
$roles = User::find(1)->roles;
$users = User::where(“status”,”=”,”active”
->orWhere(“status”,”=”,”active”)
->find([“id”,”username”,”status”]);
DB::table(“user”)
->where(“status”,”=”,”active”)
->orWhere(“status”,”=”,”active”)
->find([“id”,”username”,”status”]);
31. QUEUES
Publish a job onto the queue
Job handler
Queue::push('SendEmail@fire',
array('message' => $message),
'emails');
36. DOTENV
Instead of a variety of confusing, nested
environment configuration directories,
Laravel 5 now utilizes DotEnv by Vance
Lucas
37. ROUTE MIDDLEWARE
HTTP middleware provide a convenient mechanism
for filtering HTTP requests entering your application
php artisan route:middleware DemoMiddleware
38. ROUTE & CONFIG CACHE
php artisan route:cache
php artisan route:clear
php artisan config:cache
php artisan config:clear
44. EVENT & LISTENER
Event classes are typically stored in
the app/Events directory, while their listeners
are stored in app/Listeners
45. FLYSYSTEM
Integrations : Laravel - Symfony - Zend Framework
- CakePHP - Yii 2 …
Adapters : Local - Amazon Web Services -
Rackspace Cloud Files - Dropbox - Ftp - Sftp - Zip
- WebDAV - PHPC - Azure Blob Storagev
48. MEGAADS & LARAVEL
Controller: Frontend, Backend, Services: RESTful webservice
View with AngularJS: AJAX request
SOA with IoC, AbtractService class
Seach engine: Elasticsearch
Async, RPC with Message queue: gearman