Lumen Microservices: Create Services and APIs with Lumen
4.4 (381 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
1,379 students enrolled

Lumen Microservices: Create Services and APIs with Lumen

With Lumen by Laravel, build a complete set of PHP microservices and APIs and its security layers using Lumen and OAuth2
4.4 (381 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
1,379 students enrolled
Last updated 5/2020
English
English [Auto-generated]
Current price: $41.99 Original price: $59.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 4 hours on-demand video
  • 2 articles
  • 1 downloadable resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Build multiple different microservices using Lumen de Laravel
  • Create a service-oriented architecture from scratch using the Lumen microframework
  • Implements a complete security system to control access to internal and external architectural services
  • Feel confident to create and implement service-oriented architectures using Lumen de Laravel
  • Master the best practices of construction and implementation of a complete architecture oriented to services
Course content
Expand all 61 lectures 04:08:21
+ Introduction
3 lectures 10:22

Know a little about the instructor and some interesting details of the course.

Preview 03:37

Before starting to create things, it is important to understand the goals. See how everything should work along to the features of the microservices architecture.

Preview 06:25

Here I share the details about the different repositories where you can find the source code of the microservices and components implemented with Lumen during the course.

The source code of the course
00:20

Answer these questions, so that you are sure that you have understood the details about the service-oriented architecture you will implement with Lumen during the course.

Make sure you have understood the architecture you will implement with Lumen.
2 questions
+ Creating a first microservice for authors with Lumen
9 lectures 43:00

It is time to obtain the structure of Lumen, using composer to start with the microservice of authors.

Obtaining the Lumen structure for the authors' service
05:44

Here I explain a little about the development environment that I recommend to follow the course. However, you are free to use the tools with which you feel best to follow the course.

About the development environment to use in the course
01:55

Once you have the Lumen structure, you have to prepare and configure some components so that the microservice works correctly

Preparing the service for its correct operation
05:48

With migrations, you can create the structure of the table that will store the information related to the authors that will manage the microservice.

Building the authors table with a migration of Lumen
05:09

Through the model, you can access the full power of Eloquent, the ORM of Lumen, to manage the authors of the microservice easily.

Creating the authors' model
03:46

Creating a Factory for the authors in the microservice will allow to easily generating test data that will help fill the database with Lumen.

Creating a factory for authors and building test values
06:07

The controller will allow you to build the actions that will be in charge of managing the authors of the microservice, all through Lumen and its ORM.

Creating the controller for authors
04:31

The routes will help you build that bridge between the actions of your controller and the URLs through which you would access the microservice.

Creating the routes for CRUD operations on the authors
05:10

It is important that you be consistent in the format and type of responses that all your services return. In this class, you will centralize this to standardize the answers.

Normalizing the authors' microservice responses
04:50

Before proceeding, it is a good idea to understand in detail some concepts and components that will be useful throughout the course.

Make sure you understand several essential concepts and components
2 questions
+ Implementing the functions of the authors' microservice in Lumen
6 lectures 28:55

The first method to implement is the index method, which will return the full list of microservice authors.

Showing the list of authors from the Lumen controller
03:01

The store method of the driver will allow you to create new author instances for the microservice. Everything, using Lumen and its ORM.

Allowing creating author instances from the controller
06:01

The show method receives the path parameter that will allow you to identify a single author and return it as a response from the microservice. In addition, Lumen will help you control the possibility that this id does not exist

Allowing showing an author with a given id with Lumen
02:55

The update method will help you identify and edit an existing author of the microservice with Lumen.

Allowing editing an existing author
06:03

By implementing the destroy method of the driver, you can remove an existing author from the microservice.

Allowing deleting an existing author
02:56

You must make sure you are consistent in all possible microservice responses, and that includes error responses as well.

Handling important errors and exceptions with Lumen
07:59
+ Creating the book microservice with Lumen
8 lectures 23:59

Get the structure of Lumen, using composer to start with the microservice of books

Getting the structure of Lumen for the book microservice
03:49

You must prepare and configure some components of Lumen so that the microservice works correctly

Preparing the books microservice
03:15

With the migrations, you will create the structure of the table that will contain the information related to the books that this microservice is responsible for.

Creating the table for books with migrations
03:58

Through the model, you can access the full power of Eloquent, the ORM of Lumen, and manage the books of this microservice easily.

Creating the model for books
02:16

Create a Factory for the books in this microservice, and generate test data that will help fill the database with Lumen.

Creating a factory for books and generating random values
03:29

Build the actions that will be responsible for managing the books that will be responsible for this microservice with Lumen.

Creating the Lumen controller for books
02:45

The routes will help you build the bridge between the actions of your controller and the URLs through which you will access the microservice.

Creating the Lumen routes for CRUD operations on books
02:02

You must maintain the same format and response structure of the authors' service in this microservice.

Standardizing the responses across the services
02:25
+ Implementing the microservice functions for books in Lumen
6 lectures 16:33

The index method will allow you to return the complete list of books of this microservice.

Showing the complete list of books
01:53

Allows you to create new instances of books, implementing the controller's store method

Allowing creating new instances of books
03:10

The show-receive method allows you to identify and return the details of an existing book in response to the microservice. Lumen will help you control the possibility that this id does not exist

Allowing showing a specific book
02:29

The update method will allow you to identify and edit an existing microservice book with Lumen.

Allowing updating an existing book
03:29

The destroy method of the controller will allow you to delete an existing microservice book.

Allowing removing an existing book
02:27

Make sure you always return valid answers and in the proper format even in case of error.

Handling relevant errors and exceptions with Lumen
03:05
+ Creating and preparing the API Gateway with Lumen
7 lectures 28:40

Get the structure of a new Lumen project where you will implement all the components of the Gateway API.

Creating the Lumen project for the API Gateway using Composer
02:46

Configure the Gateway to function and act correctly with Lumen.

Preparing Lumen for the API Gateway
02:27

The Gateway will center the functions of all the microservices so it will be necessary to create Lumen controllers for each one

Creating the controllers for the authors and books Lumen microservices
03:16

You must maintain the format and structure of the answers in all your microservices, and this includes especially the Gateway that must centralize everything.

Unifying Lumen responses for the API Gateway
04:38

The Gateway API with Lumen will have the union of all the possible routes of the microservices to attend and direct each one of the correct ways.

Registering routes for microservices in Lumen from the Gateway
02:22

You must give the ability to redirect requests to the correct service, consuming them through HTTP with Lumen and GuzzleHttp.

Preparing the Gateway in Lumen to consume services
06:06

It is necessary to prepare and build the necessary structures that will allow particularizing the way in which the Gateway can consume the other Lumen microservices.

Preparing the Lumen components to consume the internal services
07:05
+ Implementing the functions of the Gateway with Lumen
8 lectures 28:52

Consume the authors' service to obtain and return the complete list of authors. Everything must work through the Gateway Controllers.

Obtaining the list of authors from the authors' Lumen microservice
04:18

Consume the authors' service to create and return a new author, using the controllers and services of the Gateway with Lumen.

Creating an author instance with the authors' service
03:15

It consumes the microservice of Lumen authors to obtain and return an author, from a received identifier.

Showing an author instance using the authors' Lumen microservice
02:12

Obtain and edit an existing author through the microservice of authors and everything from the Gateway.

Editing author instances using the authors' service
02:39

Remove an author instance using the microservice from the Lumen Gateway.

Deleting author instances using the authors' Lumen service
02:19

From the operations already implemented for authors, it is time to do something similar for the books, using the respective micro-service from Lumen.

Implementing operations for books based on the authors ones
04:56

The Gateway API will be in charge of verifying that an author exists before allowing creating a book.

Checking the existence of the author before creating a book
04:42

Like all other microservices, the Gateway is also susceptible to errors and must be controlled, in addition to handling the errors of the architecture's internal services.

Controlling errors obtained from services
04:31
+ Implementing the security layer of the microservices architecture with Lumen
7 lectures 36:49

Add Passport as a dependency, which will allow you to easily implement the security for the Gateway API through OAuth2.

Installing and enabling Lumen Passport components
03:40

You must add some components and execute some commands to allow the Gateway to protect and provide access to protected routes of the microservices architecture.

Preparing and configuring Lumen to use Passport
07:04

Once you have everything installed and ready, you can protect all Gateway routes, so that they require a valid access token. Using Lumen Passport of course.

Protecting the Gateway routes with Lumen Passport
04:59

Now that your routes are protected, you must know how to obtain a valid access token that allows you to access routes protected with Lumen Passport.

Obtaining and using access tokens for the Lumen API Gateway
06:07

Now, the Gateway must be able to identify itself in front of other microservices of the architecture so that these then allow access, using secret keys.

Preparing the API Gateway to authenticate its requests
04:52

Now that the Gateway can authenticate itself, it is time to avoid direct access to the author service so that only the Gateway can make requests to it.

Authenticating direct access to the Lumen authors microservice
05:59

In the same way you did with the microservice for authors, it is time to proceed with the books one to avoid direct access to it.

Authenticating direct access to the microservice of books
04:08
+ Authenticating user access with access tokens
5 lectures 27:55

First of all, you need a table to store users. To do this, you will use a migration taken from Laravel.

Creating the migration for the users table in Lumen
05:57

Now that you have where to store users, it is time to add all possible actions to users. Create, display, update and delete users.

Creating the controller and the routes to manage users in Lumen
04:42

Now that you have different actions for users, it is necessary to solve some important details when creating a user.

Fixing some details related to user operations
06:32

It is time to see how to create a user and use their credentials to obtain an access token.

Creating users and creating access tokens associated with users
04:00

Now that you can have an access token associated with a user, you can protect the routes properly and also identify the user behind a received token.

Identifying an authenticated user through access token
06:44
+ Conclusions and recommendations
2 lectures 03:15

Now I share some comments and recommendations to continue with confidence the process with microservices and service-oriented architectures with Lumen.

Preview 02:07

There is nothing left but to thank you and congratulate you for taking the course and reaching the end.

Preview 01:08
Requirements
  • Have PHP installed (at least PHP 7.1 is recommended).
  • A code editor or IDE of preference (any of your choice).
  • General knowledge of PHP
  • Basic knowledge of object-oriented programming
  • Install Postman in the system (it will be used to check the operation of the services)
Description

Implement from scratch a complete service-oriented architecture with PHP, using Lumen by Laravel.

Lumen is a PHP microframework based on Laravel (a PHP framework), which makes it ideal to implement microservices along with rapid and light systems.

During this course, I will show you the whole process to implement a service-oriented architecture with PHP and using Lumen;  implementing a set of microservices and its interactions. Build the entire security and interaction systems between each microservice. All of that using PHP with Lumen.


So, do not wait any more, and enroll now :)


Why should you take this course?

  • Because it gives you a detailed view, as in no other course, of a service-oriented architecture that is fully functional and secured using PHP and Lumen.

  • Because you will be able and confident enough to implement your microservices and architectures using Lumen and PHP.

  • Because it not only shows you the benefits of microservices and their architectures but also shows you how to solve the challenges that microservices represents

  • Because it shows you how to secure all the microservices in the architecture and control the access to them


What will you be able to do at the end of the course?
In general, you will be able to implement any microservices architecture you need using PHP and Lumen. You will have a clear idea of ​​how to implement each microservice with Lumen, as well as how the interaction between each of these microservices should be structured, how to build a complete security layer that protects and restricts access to each microservice in the architecture using OAuth2 with Lumen/Laravel Passport along with authenticate users and use different grant types of OAuth2.

You will feel confident to take your path and carry out your projects with all the microservices and components you want with PHP and Lumen.


What will you learn exactly?

  • Create projects in Lumen by Laravel

  • Configure and use Lumen easily in your system without complex processes

  • Use Lumen properly for its ideal purpose: the microservices

  • Build a fully functional service-oriented architecture from scratch

  • Use OAuth2 to protect access to your architecture, through Lumen/Laravel Passport

  • Install and adapt Laravel Passport to Lumen projects

  • Create access tokens associated with users to handle users data and authorization flows

  • Authenticate users credentials and restrict access to only valid users if needed

  • Authorize and use different kinds of access tokens to restrict the action over your resources

  • Create a complete system of interaction between microservices through HTTP requests with GuzzleHTTP from Lumen

  • Build fully functional and adequate services with Lumen

  • Returns and builds standardized JSON responses with Lumen

  • Separate the components of a service-oriented architecture appropriately

  • Handle errors and exceptions appropriately to ensure the consistency of the entire architecture

  • Build and implement, correctly, an API Gateway for your architecture

  • Centralize the consumption of your service-oriented architecture through an API Gateway with Lumen

And a lot much more. You will have access for life to each class that makes up the course and those that will come later. You also have direct access to me, so you can ask me questions and solve all your doubts.

Do not wait any longer, cheer up and join the course and give free rein to all the possibilities that Lumen offers with a service-oriented architecture.

Who this course is for:
  • Who wants to start in the world of service-oriented architectures (SOA)
  • Who seeks to implement fast and light services using the Lumen microframework
  • Whoever wants to increase the scalability and maintainability of their projects with microservices
  • Whoever seeks to learn to create and use microservices in a complete architecture
  • Who seeks to dominate Lumen to implement microservices
  • Whoever wants to learn how to use Lumen to build complete service-oriented architectures