In this chapter, we looked at middleware, which is a useful mechanism for any functionality that should either be executed for each and every request or attached to certain routes. It is a flexible mechanism and allows the programmer to code to an interface, since any middleware class that implements the Middleware
interface must include the handle
method. Following good development principles is not only encouraged, but rather required through this type of structure.
In the next chapter, we will discuss the Eloquent ORM.