O'Reilly logo

Lumen Programming Guide: Writing PHP Microservices, REST and Web Service APIs by Paul Redmond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required