SlideShare a Scribd company logo
1 of 16
+
Lumen
The stunningly fast micro-framework by Laravel.
By: Joshua Copeland
@PsycodeDotOrg
+
Joshua Copeland
Josh@Psycode.org
- Father, Husband, Code Craftsman, and self proclaimed Computer.
@PsycodeDotOrg
LV PHP
UG
Organizer
Lead Developer
@
Selling Source
Lover of all
things tech
Proud
Father of 2
+
Server Requirements
 The Lumen framework has a few system requirements:
 PHP >= 5.4
 Mcrypt PHP Extension
 OpenSSL PHP Extension
 Mbstring PHP Extension
 Tokenizer PHP Extension
+
Homestead 5.0
 Download/Install Vagrant & Virtualbox (or VMWare)
 vagrant box add laravel/homestead
 git clone https://github.com/laravel/homestead.git ~/Homestead
 bash ~/Homestead/init.sh
 cd ~/Homestead && ./homestead edit
 #Verify settings (ssh key, blackfire, etc.)
#Edits the ~/.homestead/Homestead.yaml config file
 composer install
 #Your native machine needs php/composer to run bin from host
 vagrant up
 #Expect lots of output.
#Seeing some red text might not be an actual error.
 vagrant ssh
 #Its Alive!
+
Homestead 5.0
 Included Software
 Ubuntu 14.04
 PHP 5.6
 HHVM
 Nginx
 MySQL
 Postgres
 Node (With Bower, Grunt, and Gulp)
 Redis
 Memcached
 Beanstalkd
 Laravel Envoy
 Blackfire Profiler
 Ports
 The following ports are forwarded to your
Homestead environment:
 SSH: 2222 → Forwards To 22
 HTTP: 8000 → Forwards To 80
 HTTPS: 44300 → Forwards To 443
 MySQL: 33060 → Forwards To 3306
 Postgres: 54320 → Forwards To 5432
 Adding Additional Ports
If you wish, you may forward additional ports
to the Vagrant box, as well as specify their
protocol:
ports:
- send: 93000
to: 9300
- send: 7777
to: 777
protocol: udp
+
Lumen Installation
 Install Composer
 Lumen utilizes Composer to manage its dependencies. So, before using Lumen, you will need to
make sure you have Composer installed on your machine.
 Via Lumen Installer
 First, download the Lumen installer using Composer.
 composer global require "laravel/lumen-installer=~1.0"
 Make sure to place the ~/.composer/vendor/bin directory in your PATH so the lumen executable
can be located by your system.
 Once installed, the simple lumen new command will create a fresh Lumen installation in the
directory you specify. For instance, lumen new service would create a directory named service
containing a fresh Lumen installation with all dependencies installed. This method of installation
is much faster than installing via Composer:
 lumen new service
 Via Composer Create-Project
 You may also install Lumen by issuing the Composer create-project command in your terminal:
 composer create-project laravel/lumen --prefer-dist
+
Pretty URLs
 Apache
 The framework ships with a
public/.htaccess file that is used to
allow URLs without index.php. If you
use Apache to serve your Lumen
application, be sure to enable the
mod_rewrite module.
 If the .htaccess file that ships with
Lumen does not work with your
Apache installation, try this one:
location / {
try_files $uri $uri/ /index.php?$query_string;
}
 Nginx
 On Nginx, the following directive in
your site configuration will allow
"pretty" URLs:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
When using Homestead, pretty
URLs will be configured
automatically.
+
Directory Structure
 app/
 All your application code goes here. Console commands, service providers, routes, controllers,
middleware, exceptions, and jobs.
 bootstrap/app.php
 Create the app used as an “IoC” application container & router.
 Register container bindings, service providers, and middleware.
 database/
 public/
 The public web facing files (index.php)
 resources/
 storage/
 tests/
 vendor/
+
Configuration
 Lumen needs almost no other configuration out of the box. You are free to
get started developing!
 You may also want to configure a few additional components of Lumen:
 Cache
 Database
 Queue
 Session
 Permissions
 Lumen may require some permissions to be configured: folders within storage
directory need to be writable.
+
Configuration
 Copy .env.example to .env in root of project.
 The example config: APP_ENV=local
APP_DEBUG=true
APP_KEY=Change This!!!
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=memcached
SESSION_DRIVER=memcached
QUEUE_DRIVER=database
+
HTTP Routing
$app->post('foo/bar', function() {
return 'Hello World';
});
$app->patch('foo/bar', function() {
//
});
$app->put('foo/bar', function() {
//
});
$app->delete('foo/bar', function() {
//
});
$app->get('user/{id}', function($id) {
return 'User '.$id;
});
$app->group(
['prefix' => 'accounts/{account_id}'],
function($app)
{
$app->get('detail',
function($account_id)
{
// accounts/1234/details
});
});
+
HTTP Middleware
HTTP middleware provide a convenient mechanism for filtering HTTP requests entering your
application. For example, Lumen includes a middleware that verifies the CSRF token of your
application.
Of course, middleware can be written to perform a variety of tasks besides CSRF validation. A
CORS middleware might be responsible for adding the proper headers to all responses
leaving your application. A logging middleware might log all incoming requests to your
application.
All middleware are typically located in the app/Http/Middleware directory.
To create a new middleware, simply create a class with a handle method like the following:
public function handle($request, $next)
{
// Do stuff here, then continue request handling
return $next($request);
}
+
HTTP Controllers
<?php namespace AppHttpControllers;
use AppUser;
use AppHttpControllersController;
class UserController extends Controller {
/**
* Show the profile for the given user.
*
* @param int $id
* @return Response
*/
public function showProfile($id)
{
return view('user.profile', ['user' => User::findOrFail($id)]);
}
}
// We can route to the controller action like so
$app->get('user/{id}', 'AppHttpControllersUserController@showProfile');
+
Views
<!-- View stored in resources/views/greeting.php -->
<!doctype html>
<html>
<head>
<title>Welcome!</title>
</head>
<body>
<h1>Hello, <?php echo $name; ?></h1>
</body>
</html>
The view may be returned to the browser like so:
$app->get('/', function() {
return view('greeting', ['name' => 'James']);
});
+
Other features
• Core Features
• Cache
• Database
• Encryption
• Errors & Logging
• Events
• Helpers
• Queues
• Unit Testing
• Validation
• Full-Stack Features
• Authentication
• Filesystem / Cloud Storage
• Hashing
• Mail
• Pagination
• Session
• Templates
http://lumen.laravel.com/docs
+
Thank you!

More Related Content

What's hot

Refactoring, Emergent Design & Evolutionary Architecture
Refactoring, Emergent Design & Evolutionary ArchitectureRefactoring, Emergent Design & Evolutionary Architecture
Refactoring, Emergent Design & Evolutionary ArchitectureBrad Appleton
 
Openstack - An introduction/Installation - Presented at Dr Dobb's conference...
 Openstack - An introduction/Installation - Presented at Dr Dobb's conference... Openstack - An introduction/Installation - Presented at Dr Dobb's conference...
Openstack - An introduction/Installation - Presented at Dr Dobb's conference...Rahul Krishna Upadhyaya
 
Gupshup whats app_api_document_v1.2_29thjune
Gupshup whats app_api_document_v1.2_29thjuneGupshup whats app_api_document_v1.2_29thjune
Gupshup whats app_api_document_v1.2_29thjuneSantoshKrishnaSista
 
DevSecOps reference architectures 2018
DevSecOps reference architectures 2018DevSecOps reference architectures 2018
DevSecOps reference architectures 2018Sonatype
 
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...Edureka!
 
5 Best Practices DevOps Culture
5 Best Practices DevOps Culture5 Best Practices DevOps Culture
5 Best Practices DevOps CultureEdureka!
 
What's an SRE at Criteo - Meetup SRE Paris
What's an SRE at Criteo - Meetup SRE ParisWhat's an SRE at Criteo - Meetup SRE Paris
What's an SRE at Criteo - Meetup SRE ParisClément Michaud
 
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...Edureka!
 
Ansible Introduction
Ansible IntroductionAnsible Introduction
Ansible IntroductionGong Haibing
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with JenkinsMartin Málek
 
Azure Training | Microsoft Azure Tutorial | Microsoft Azure Certification | E...
Azure Training | Microsoft Azure Tutorial | Microsoft Azure Certification | E...Azure Training | Microsoft Azure Tutorial | Microsoft Azure Certification | E...
Azure Training | Microsoft Azure Tutorial | Microsoft Azure Certification | E...Edureka!
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaEdureka!
 
Building Repeatable Infrastructure using Terraform
Building Repeatable Infrastructure using TerraformBuilding Repeatable Infrastructure using Terraform
Building Repeatable Infrastructure using TerraformJeeva Chelladhurai
 
An Intrudction to OpenStack 2017
An Intrudction to OpenStack 2017An Intrudction to OpenStack 2017
An Intrudction to OpenStack 2017Haim Ateya
 
Releasing Software Quickly and Reliably with AWS CodePipline
Releasing Software Quickly and Reliably with AWS CodePiplineReleasing Software Quickly and Reliably with AWS CodePipline
Releasing Software Quickly and Reliably with AWS CodePiplineAmazon Web Services
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationJohn Lynch
 

What's hot (20)

Refactoring, Emergent Design & Evolutionary Architecture
Refactoring, Emergent Design & Evolutionary ArchitectureRefactoring, Emergent Design & Evolutionary Architecture
Refactoring, Emergent Design & Evolutionary Architecture
 
Openstack - An introduction/Installation - Presented at Dr Dobb's conference...
 Openstack - An introduction/Installation - Presented at Dr Dobb's conference... Openstack - An introduction/Installation - Presented at Dr Dobb's conference...
Openstack - An introduction/Installation - Presented at Dr Dobb's conference...
 
Gupshup whats app_api_document_v1.2_29thjune
Gupshup whats app_api_document_v1.2_29thjuneGupshup whats app_api_document_v1.2_29thjune
Gupshup whats app_api_document_v1.2_29thjune
 
DevSecOps reference architectures 2018
DevSecOps reference architectures 2018DevSecOps reference architectures 2018
DevSecOps reference architectures 2018
 
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...
What Is Kubernetes | Kubernetes Introduction | Kubernetes Tutorial For Beginn...
 
Terraform
TerraformTerraform
Terraform
 
5 Best Practices DevOps Culture
5 Best Practices DevOps Culture5 Best Practices DevOps Culture
5 Best Practices DevOps Culture
 
What's an SRE at Criteo - Meetup SRE Paris
What's an SRE at Criteo - Meetup SRE ParisWhat's an SRE at Criteo - Meetup SRE Paris
What's an SRE at Criteo - Meetup SRE Paris
 
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
What is DevOps | DevOps Introduction | DevOps Training | DevOps Tutorial | Ed...
 
Ansible Introduction
Ansible IntroductionAnsible Introduction
Ansible Introduction
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with Jenkins
 
Azure Training | Microsoft Azure Tutorial | Microsoft Azure Certification | E...
Azure Training | Microsoft Azure Tutorial | Microsoft Azure Certification | E...Azure Training | Microsoft Azure Tutorial | Microsoft Azure Certification | E...
Azure Training | Microsoft Azure Tutorial | Microsoft Azure Certification | E...
 
Azure devops
Azure devopsAzure devops
Azure devops
 
Accelerating with Ansible
Accelerating with AnsibleAccelerating with Ansible
Accelerating with Ansible
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
 
Building Repeatable Infrastructure using Terraform
Building Repeatable Infrastructure using TerraformBuilding Repeatable Infrastructure using Terraform
Building Repeatable Infrastructure using Terraform
 
An Intrudction to OpenStack 2017
An Intrudction to OpenStack 2017An Intrudction to OpenStack 2017
An Intrudction to OpenStack 2017
 
Releasing Software Quickly and Reliably with AWS CodePipline
Releasing Software Quickly and Reliably with AWS CodePiplineReleasing Software Quickly and Reliably with AWS CodePipline
Releasing Software Quickly and Reliably with AWS CodePipline
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Ansible
AnsibleAnsible
Ansible
 

Viewers also liked

Lumen Website Design
Lumen Website DesignLumen Website Design
Lumen Website DesignCory McCord
 
Lumen Brand Guidelines
Lumen Brand GuidelinesLumen Brand Guidelines
Lumen Brand GuidelinesCory McCord
 
Introduce lumen php micro framework
Introduce lumen php micro frameworkIntroduce lumen php micro framework
Introduce lumen php micro frameworkJung soo Ahn
 
MYP lighting slide show
MYP lighting slide showMYP lighting slide show
MYP lighting slide showC Rankin
 
Lumen Gentium
Lumen GentiumLumen Gentium
Lumen GentiumStSimons
 
Lumen gentium
Lumen gentium  Lumen gentium
Lumen gentium CaEdBeSi
 
Daylighting slideshare
Daylighting slideshareDaylighting slideshare
Daylighting slideshareParween Karim
 
Light.ppt
Light.pptLight.ppt
Light.pptinaino
 
Light and architecture
Light and architectureLight and architecture
Light and architectureAtul Pathak
 
Lighting Powerpoint
Lighting PowerpointLighting Powerpoint
Lighting Powerpointshawn8492
 
LIGHT AND LIGHTING FIXTURES
LIGHT AND LIGHTING FIXTURESLIGHT AND LIGHTING FIXTURES
LIGHT AND LIGHTING FIXTURESShamba Sarkar
 

Viewers also liked (14)

Lumen Website Design
Lumen Website DesignLumen Website Design
Lumen Website Design
 
Lumen Brand Guidelines
Lumen Brand GuidelinesLumen Brand Guidelines
Lumen Brand Guidelines
 
Introduce lumen php micro framework
Introduce lumen php micro frameworkIntroduce lumen php micro framework
Introduce lumen php micro framework
 
MYP lighting slide show
MYP lighting slide showMYP lighting slide show
MYP lighting slide show
 
Lumen Gentium
Lumen GentiumLumen Gentium
Lumen Gentium
 
Lumen gentium
Lumen gentium  Lumen gentium
Lumen gentium
 
Daylighting slideshare
Daylighting slideshareDaylighting slideshare
Daylighting slideshare
 
Daylighting Buildings
Daylighting BuildingsDaylighting Buildings
Daylighting Buildings
 
Basics of Indoor Lighting
Basics of Indoor LightingBasics of Indoor Lighting
Basics of Indoor Lighting
 
Light.ppt
Light.pptLight.ppt
Light.ppt
 
Light and architecture
Light and architectureLight and architecture
Light and architecture
 
Light.ppt
Light.pptLight.ppt
Light.ppt
 
Lighting Powerpoint
Lighting PowerpointLighting Powerpoint
Lighting Powerpoint
 
LIGHT AND LIGHTING FIXTURES
LIGHT AND LIGHTING FIXTURESLIGHT AND LIGHTING FIXTURES
LIGHT AND LIGHTING FIXTURES
 

Similar to Lumen

WP Sandbox Presentation WordCamp Toronto 2011
WP Sandbox Presentation WordCamp Toronto 2011WP Sandbox Presentation WordCamp Toronto 2011
WP Sandbox Presentation WordCamp Toronto 2011Alfred Ayache
 
How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04Sanjary Edu
 
Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2benjaminwootton
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudSalesforce Developers
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabricandymccurdy
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stackRootGate
 
APACHE
APACHEAPACHE
APACHEARJUN
 
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-NapocaWP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-Napoca4nd4p0p
 
R hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing HadoopR hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing HadoopAiden Seonghak Hong
 
Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009Helgi Þormar Þorbjörnsson
 
WordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry PiWordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry PiYuriko IKEDA
 
Chef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructureChef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructureMichaël Lopez
 
Installing Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu InstanceInstalling Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu Instancekamarul kawnayeen
 

Similar to Lumen (20)

WP Sandbox Presentation WordCamp Toronto 2011
WP Sandbox Presentation WordCamp Toronto 2011WP Sandbox Presentation WordCamp Toronto 2011
WP Sandbox Presentation WordCamp Toronto 2011
 
Its3 Drupal
Its3 DrupalIts3 Drupal
Its3 Drupal
 
How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04How to Install LAMP in Ubuntu 14.04
How to Install LAMP in Ubuntu 14.04
 
Sahu
SahuSahu
Sahu
 
Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the Cloud
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
 
APACHE
APACHEAPACHE
APACHE
 
Its3 Drupal
Its3 DrupalIts3 Drupal
Its3 Drupal
 
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-NapocaWP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
 
Installing lemp with ssl and varnish on Debian 9
Installing lemp with ssl and varnish on Debian 9Installing lemp with ssl and varnish on Debian 9
Installing lemp with ssl and varnish on Debian 9
 
R hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing HadoopR hive tutorial supplement 1 - Installing Hadoop
R hive tutorial supplement 1 - Installing Hadoop
 
Apache
ApacheApache
Apache
 
Apache
ApacheApache
Apache
 
Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009
 
Apache Ppt
Apache PptApache Ppt
Apache Ppt
 
WordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry PiWordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry Pi
 
Chef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructureChef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructure
 
Installing Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu InstanceInstalling Lamp Stack on Ubuntu Instance
Installing Lamp Stack on Ubuntu Instance
 

More from Joshua Copeland

More from Joshua Copeland (7)

Web scraping 101 with goutte
Web scraping 101 with goutteWeb scraping 101 with goutte
Web scraping 101 with goutte
 
WooCommerce
WooCommerceWooCommerce
WooCommerce
 
Universal Windows Platform Overview
Universal Windows Platform OverviewUniversal Windows Platform Overview
Universal Windows Platform Overview
 
LVPHP.org
LVPHP.orgLVPHP.org
LVPHP.org
 
PHP Rocketeer
PHP RocketeerPHP Rocketeer
PHP Rocketeer
 
PHP 7
PHP 7PHP 7
PHP 7
 
Blackfire
BlackfireBlackfire
Blackfire
 

Recently uploaded

SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 

Recently uploaded (20)

SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 

Lumen

  • 1. + Lumen The stunningly fast micro-framework by Laravel. By: Joshua Copeland @PsycodeDotOrg
  • 2. + Joshua Copeland Josh@Psycode.org - Father, Husband, Code Craftsman, and self proclaimed Computer. @PsycodeDotOrg LV PHP UG Organizer Lead Developer @ Selling Source Lover of all things tech Proud Father of 2
  • 3. + Server Requirements  The Lumen framework has a few system requirements:  PHP >= 5.4  Mcrypt PHP Extension  OpenSSL PHP Extension  Mbstring PHP Extension  Tokenizer PHP Extension
  • 4. + Homestead 5.0  Download/Install Vagrant & Virtualbox (or VMWare)  vagrant box add laravel/homestead  git clone https://github.com/laravel/homestead.git ~/Homestead  bash ~/Homestead/init.sh  cd ~/Homestead && ./homestead edit  #Verify settings (ssh key, blackfire, etc.) #Edits the ~/.homestead/Homestead.yaml config file  composer install  #Your native machine needs php/composer to run bin from host  vagrant up  #Expect lots of output. #Seeing some red text might not be an actual error.  vagrant ssh  #Its Alive!
  • 5. + Homestead 5.0  Included Software  Ubuntu 14.04  PHP 5.6  HHVM  Nginx  MySQL  Postgres  Node (With Bower, Grunt, and Gulp)  Redis  Memcached  Beanstalkd  Laravel Envoy  Blackfire Profiler  Ports  The following ports are forwarded to your Homestead environment:  SSH: 2222 → Forwards To 22  HTTP: 8000 → Forwards To 80  HTTPS: 44300 → Forwards To 443  MySQL: 33060 → Forwards To 3306  Postgres: 54320 → Forwards To 5432  Adding Additional Ports If you wish, you may forward additional ports to the Vagrant box, as well as specify their protocol: ports: - send: 93000 to: 9300 - send: 7777 to: 777 protocol: udp
  • 6. + Lumen Installation  Install Composer  Lumen utilizes Composer to manage its dependencies. So, before using Lumen, you will need to make sure you have Composer installed on your machine.  Via Lumen Installer  First, download the Lumen installer using Composer.  composer global require "laravel/lumen-installer=~1.0"  Make sure to place the ~/.composer/vendor/bin directory in your PATH so the lumen executable can be located by your system.  Once installed, the simple lumen new command will create a fresh Lumen installation in the directory you specify. For instance, lumen new service would create a directory named service containing a fresh Lumen installation with all dependencies installed. This method of installation is much faster than installing via Composer:  lumen new service  Via Composer Create-Project  You may also install Lumen by issuing the Composer create-project command in your terminal:  composer create-project laravel/lumen --prefer-dist
  • 7. + Pretty URLs  Apache  The framework ships with a public/.htaccess file that is used to allow URLs without index.php. If you use Apache to serve your Lumen application, be sure to enable the mod_rewrite module.  If the .htaccess file that ships with Lumen does not work with your Apache installation, try this one: location / { try_files $uri $uri/ /index.php?$query_string; }  Nginx  On Nginx, the following directive in your site configuration will allow "pretty" URLs: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] When using Homestead, pretty URLs will be configured automatically.
  • 8. + Directory Structure  app/  All your application code goes here. Console commands, service providers, routes, controllers, middleware, exceptions, and jobs.  bootstrap/app.php  Create the app used as an “IoC” application container & router.  Register container bindings, service providers, and middleware.  database/  public/  The public web facing files (index.php)  resources/  storage/  tests/  vendor/
  • 9. + Configuration  Lumen needs almost no other configuration out of the box. You are free to get started developing!  You may also want to configure a few additional components of Lumen:  Cache  Database  Queue  Session  Permissions  Lumen may require some permissions to be configured: folders within storage directory need to be writable.
  • 10. + Configuration  Copy .env.example to .env in root of project.  The example config: APP_ENV=local APP_DEBUG=true APP_KEY=Change This!!! APP_LOCALE=en APP_FALLBACK_LOCALE=en DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret CACHE_DRIVER=memcached SESSION_DRIVER=memcached QUEUE_DRIVER=database
  • 11. + HTTP Routing $app->post('foo/bar', function() { return 'Hello World'; }); $app->patch('foo/bar', function() { // }); $app->put('foo/bar', function() { // }); $app->delete('foo/bar', function() { // }); $app->get('user/{id}', function($id) { return 'User '.$id; }); $app->group( ['prefix' => 'accounts/{account_id}'], function($app) { $app->get('detail', function($account_id) { // accounts/1234/details }); });
  • 12. + HTTP Middleware HTTP middleware provide a convenient mechanism for filtering HTTP requests entering your application. For example, Lumen includes a middleware that verifies the CSRF token of your application. Of course, middleware can be written to perform a variety of tasks besides CSRF validation. A CORS middleware might be responsible for adding the proper headers to all responses leaving your application. A logging middleware might log all incoming requests to your application. All middleware are typically located in the app/Http/Middleware directory. To create a new middleware, simply create a class with a handle method like the following: public function handle($request, $next) { // Do stuff here, then continue request handling return $next($request); }
  • 13. + HTTP Controllers <?php namespace AppHttpControllers; use AppUser; use AppHttpControllersController; class UserController extends Controller { /** * Show the profile for the given user. * * @param int $id * @return Response */ public function showProfile($id) { return view('user.profile', ['user' => User::findOrFail($id)]); } } // We can route to the controller action like so $app->get('user/{id}', 'AppHttpControllersUserController@showProfile');
  • 14. + Views <!-- View stored in resources/views/greeting.php --> <!doctype html> <html> <head> <title>Welcome!</title> </head> <body> <h1>Hello, <?php echo $name; ?></h1> </body> </html> The view may be returned to the browser like so: $app->get('/', function() { return view('greeting', ['name' => 'James']); });
  • 15. + Other features • Core Features • Cache • Database • Encryption • Errors & Logging • Events • Helpers • Queues • Unit Testing • Validation • Full-Stack Features • Authentication • Filesystem / Cloud Storage • Hashing • Mail • Pagination • Session • Templates http://lumen.laravel.com/docs