Kernelclass. All middleware are just classes that contain a
Kernelfile and are
http_middlewareis a simple list which should contain your middleware classes. This attribute is a list because all middleware will simply run in succession one after another, similar to Django middleware
Kernelfile this type of middleware may look something like:
config/middleware.pyfile this might look something like:
By default, all routes inside the
web.pyfile will run the
:symbol next to your route middleware name and then pass in those parameters to the
:splice we can also use the
@in the value to pass the value of the parameter.
/dashboard/152/settingsthen the value of 152 will be passed to the middleware before and after methods.
.middleware()method onto our routes. This will look something like: