© Paul Redmond 2016

Paul Redmond, Lumen Programming Guide, 10.1007/978-1-4842-2187-7_2

2. Hello Lumen

Paul Redmond

(1)Phoenix, Arizona, USA

Let’s dive right into Lumen. In this chapter, you’ll learn how to set up a new Lumen project and you’ll explore some of Lumen’s basic features:

  • Routing

  • Middleware

  • Requests

  • Responses

To follow along, you should have the recommended Homestead environment from Chapter 1 installed.

Setting Up a New Project

Before you can get started, you need to create a new Lumen project in Homestead. To create a new project, ssh into Homestead virtual machine and use Composer to create a new Lumen project (Listing 2-1).

Listing 2-1. Creating a New Lumen Application in Homestead
# On your local machine$ cd ∼/Code/Homestead$ vagrant ssh ...

Get Lumen Programming Guide: Writing PHP Microservices, REST and Web Service APIs now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.