Buying for a Team? Gift This Course
Wishlisted Wishlist

Please confirm that you want to add Create Fast RESTful APIs with Lumen and Homestead by Laravel to your Wishlist.

Add to Wishlist

Create Fast RESTful APIs with Lumen and Homestead by Laravel

Lumen, a micro-framework by Laravel, is the best way for faster RESTful APIs. Create a RESTful API with Lumen/Homestead
4.3 (91 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
1,085 students enrolled
Created by JuanD MeGon
Last updated 1/2016
$10 $60 83% off
3 days left at this price!
30-Day Money-Back Guarantee
  • 3 hours on-demand video
  • 2 Articles
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Have a coupon?

Create an agile and fast RESTful API with Lumen from scratch and step-by-step

This course has classes about all the recent Lumen versions (5.1 and 5.2)!

In this course you are going to learn to develop a professional and fully functional RESTful APIs using Lumen, the micro-framework based on Laravel.

Lumen is a micro-framework for PHP based on laravel, combining the most highlighted features of laravel in a much lighter and faster version.

Why Lumen?

Lumen has the best features of Laravel in a more light and quick version , while remaining expressive, intuitive, powerful and especially simple .

With Lumen your API will support at least twelve hundred (1200) requests in a range of 10 seconds with 10 simultaneous requests. This great speed makes it the perfect candidate for implementing a RESTful API in it, and the best, it is completely easy!

Millions of programmers of PHP use Laravel and all of them are agree with the incredible ease and agility that Lumen provides for micro services, including of course, RESTful APIs, so, what are you waiting for? Take it now!

Lumen for PHP have been included new concepts and facilities, similar to Laravel allowing you to create fast, agile but powerful RESTful API easily.

You are going to obtain this specific knoledge and skills during the course:

  • Major differences and facilities of Lumen VS Laravel
  • Creating a development environment with Homestead
  • Interaction with Vagrant virtual machines
  • Configure Homestead with Vagrant virtual sites
  • Configure and use the code editor Sublime Text 3
  • Using PHP artisan for creating code
  • Global Middlewares and route middleware
  • Create models
  • Relationships one to many between models (1: N)
  • Relationships many to many between models (N: N)
  • Tables intermediary or pivot
  • Validation of requests
  • Management and control of exceptions and errors
  • Migrations (automatic creation of databases)
  • Seeds (Automatic Insertion databases)
  • Factories , to create test/fake data
  • Creating a server OAuth 2
  • Generate access_token
  • Resource protection with access token
  • Restrict access through access token
  • Improving framework for production
  • Interaction with the database through Eloquent
  • Much, much more.

During the course will create a RESTful API from scratch , following the REST architecture and the proper construction of URLs to identify actions and resources using the controllers and routes for resources on Lumen.

Hone the characteristics of your work tools ( Sublime Text 3, Git shell, Lumen, Composer, artisan PHP ) and improve your productivity for development agile.

Learn to develop a local project on Windows with Homestead , how to interact with the virtual machine Vagrant , with the operative system Ubuntu through a connection ssh .

You'll see how to use Lumen through the console PHP artisan to build agile a RESTful API that responds to methods of HTTP ( GET, POST, PUT, and DELETE PATCH ), also populate the database structure and build an automated manner.

It does not end there! Will have access for life for the additional classes that are constantly be adding to the course.

Upon completion of this course you will be able to develop your own RESTful API with Lumen and PHP and including micro-services, in a quick and simple way, exploiting the facilities provided by this micro-framework for the proper and adequate implementation of your projects.

Do not wait to be proficient in PHP and RESTful. Join the course and see you in class

Who is the target audience?
  • Who likes programming and web development
  • Who want to encrease his skills to the next level
  • Who are looking for domain the most recent techniques for web development
  • Who want to be clever on web development with PHP
Students Who Viewed This Course Also Viewed
What Will I Learn?
Domain the most recent tools for web development
Use light and agile tools to professional web projects
Development of high complexity projects, in few time
Deeper and professional knowledge about web development with PHP
View Curriculum
  • PHP Programming (basic knowledge its enough)
  • Basic OOP knowledge (classes, functions)
Curriculum For This Course
Expand All 31 Lectures Collapse All 31 Lectures 02:55:09
Starting with the Course
4 Lectures 07:47

How to use the platform, use the resources and leave comments

Preview 02:30

Lets to know a little about me, my skills, my experience and projects.

About me

How to take advantage of the classes, how every class and content works.

Some Important Details!

During this class you are going to discover, why Lumen is the best choise to develop a RESTful API,

Preview 02:56
Setting the Development Environment
5 Lectures 24:51

During this class you are going to download and install:

  • Oracle Virtual Box
  • Vagrant
  • Git/Github (Shell)
  • PHP and Composer
  • Sublime Text 3
Downloading and Installing all the Required Tools

During this class you are going to get a Lumen 5.1 instance and you are going to link it to homestead as a project dependency. It mean a Homestead instance per project.

Obtaining Lumen and Linking it to Homestead

During this class you are going to install, obtain and use Homestead.

Homestead: Is a previously created and designed box for Vagrant, wich provides a easily way to deploy and develop Laravel/Lumen projects (mainly).

Installing, Configuring and Testing Homestead

During the class you are going to learn how to install the most useful add-ons to Sublime Text 3 for a faster development.

Sublime Text 3: Is a free code editor. Useful to develop projects in multiple programming languages wich includes PHP.

Configuring Sublime Text 3

You'll see how Vagrant works and how to use it easily and faster.

Preview 04:24

Let check if you know every component of your development environment

[Exercise] Do you Know Your Development Environment?
4 questions
Programming the Main Project Structure for Lumen
6 Lectures 45:35

This course, provide you a great advantage, which allow you to follow and check the code for every content and every class. How the project evolves, what changed in every class, copy/edit easily the code.

The Great Advantage of this Course

Learn how Lumen is structured and organized. Know the main differences between Laravel and Lumen. Learn how to enable the most essencial and useful features of Lumen for a much more easy programming.

Configuring Lumen and Reviewing the Structure

During this class you'll see how to create the models easily using php artisan and the relationship between those models (many to many and one to many).

Creating the Models and the Relationships

During this class you are going to use the Lumen migrations feature to create the tables associated with every model and their attributes for the relationships. It includes the pivos table for the many to many relationship.

Creating the Database Structure Using Migrations of Lumen

During this class you are going to seed the database using factories of Lumen to create fake data and test the database structure and project.

Inserting Fake Data, Using Faker Into Factories and Seeds

During this class you are going to create the routes to manage (create, read, update and delete) resources in the RESTful API and the required controllers to manage all the kind of requests, like this:

  • index method => Is used to show all the resources associated with the request => Uses the GET HTTP method.
  • store method => Used to store a new resource => Uses the POST HTTP method.
  • show => Used to show an specific resource (by id) => Uses the GET HTTP method.
  • update => Used to update/change a resource data => Responses to PATCH/PUT HTTP methods.
  • delete => Remove a specified resource => Responses to the DELETE HTTP method.
Creating the REST Routes and the Controllers

Verify if you know the main components of the Lumen structure.

[Exercise] Do You Know the Lumen Structure and Components?
3 questions
Programming The Operations for Simple Resources in the RESTful API
4 Lectures 31:42

During this class you are going to develop the functions to show data associated with the simple resrouces of the RESTful API (Teachers, Courses and Students).

The index and show method responses to the GET HTTP method.


  1. The index method show ALL the requestes resources
  2. The show method show ONLY the requested resource (if exsists)
Implementing The Features to Show Simple Resources

During this class you are going to implement the method that allow you to insert simple recources (students and teachers).

Take into account that the POST method of HTTP is used to create/inser data or new resources into de database.

Implementing The Features to Insert Simple Resources

During the class you are going to implement the methods to update/edit existing simple resoruces.

In this case you can:

  • Edit an existing teacher.
  • Edit/update an existing student.

The method update responses to the PUT and PATCH methods of the HTTP protocol.

Notice: Due to the HTTP protocol definition, PHP and therefore Laravel, recibes values for this methods ONLY when are sent using the www-url-encode way instead of form-params.

Implementing The Features to Edit Simple Resources

During this class you are going to implement the method "destroy" to delete simple resources (Student and Teacher).

The destroy method response to the DELETE method of HTTP and just remove an existing resource.

PS: At the moment of delete resources, we need to be very careful with the foreign keys because a resoruce can't be deleted if another resource depends of them. For example, a teacher can't be deleted witouth remove first the associated courses (or assign a new teacher).

Implementing The Features to Remove Simple Resources
Programming The Operations for Nested Resources in the RESTful API
4 Lectures 29:54

During the class you are going to develop the method to show data about the nested resources, it means:

  1. Show the students taking a course and,
  2. Show the courses taught by a teacher

The index method responses to the GET HTTP method.


  • The index method show all the required resources.
Implementing the Methods to Show Nested Resources

During this lecture you are going to develop the the methods which allow you to insert or create nested resources.

In thiis case:

  • Create a course with a specific teacher
  • Add a existent student to an existent course

The store method is used to create/insert new resources into the database. The store method responses to the POST method of the HTTP protocol.

Implementing the Methods to Insert Nested Resources

During the class you are going to develop the method to update/edit an existing nested resoruce.

In this case you can edit a specific course that is associated with a specific teacher. Remember that the students and the courses can be updated by themself methods, so the CourseStudentController does not need the update method.

The method update responses to the PUT and PATCH methods of the HTTP protocol.

Notice: Due to the HTTP protocol definition, PHP and therefore Laravel, recibes values for this methods ONLY when are sent using the www-url-encode way instead of form-params.

Implementing the Method to Edit a Nested Resource

During the class you are going to develop the functions to remove nested resources or in specific cases to remove the relationship between them.

In this case you are going to:

  • Delete a course associated with a specifi teacher.
  • Remove a student from a specific course.

The destroy method responses to the DELETE method of the HTTP protocol and delete an element or a relationship from the database.

PS: At the moment to remove an element you have to be careful with the foreign keys because a course can not be deleted witouth remove all the relationships with the students.

Implementing the Functions to Remove Nested Resources
Security, Access and Requests Validation
4 Lectures 21:51

During this lecture you are going to meet OAuth2, a mechanism to validate requests and the access to specific resoruces or operations, giving a more detailed ans specific control hover the resources.

Preview 03:49

During this section you are going to add the OAuth2 Server as a dependency of your Lumen project and then install all the required database tables, values and files for the configuration.

Obtaining and Installing the OAuth2 Server on Lumen

The OAuth2 server is almost done, you need to add a grant_type to obtain the access tokens, run the migrations and create a client to test how it is working.

Configuring and Testing The OAuth2 Server

During this class you are going to finally specify which routes and operations you want to protect through the OAuth2 middleware.

Def: A middleware is a mechanisms that is executed before to attend a requests, if the middleware "decide" to pass the requests all works, but if not the requests is rejected. In Lumen you can execute a middleware for every request or for a specific requests.

Protecting the Resources and Operations Using an OAuth2 access_token
Finalizing Details
2 Lectures 08:03

Something can fail during the RESTful API execution and, for that reason is neccessary to catch all the possible failures in a firendly way and avoid unexpected behaviours.

Handling Errors and Exceptions in the RESTful API

During the development somethings lost the speed and efficiency, so it is neccessary to run som specific tasks to restore the original efficiency and works at the 100% of capacity.

Preview 02:57

Verify if you know why are important these details

Check the Details Again
2 questions
Upgrading to Lumen 5.2
1 Lecture 03:58
Upgrading from Lumen 5.1 to Lumen 5.2
Thank You!
1 Lecture 01:23

Nothing is finished yet! The course is going to have new classes along the time, new contents and of course I'm going to answer all your question and comments every time.

Preview 01:23
About the Instructor
4.5 Average rating
786 Reviews
4,341 Students
10 Courses
Experienced Web Developer, Programmer and Instructor

Systems and Informatics Engineer - Web Developer

Professional Instructor. Founder of ProgramarYa.

Found professional courses about web development with high quality and availability, PHP, Laravel and Web Development in general.


Ingeniero de sistemas e informática - Desarrollador Web.

Instructor profesional y fundador de ProgramarYa.

Encuentra cursos profesionales sobre PHP, Laravel y de desarrollo web en general, con alta calidad y disponibilidad.

Report Abuse