Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 950 Bytes

File metadata and controls

14 lines (10 loc) · 950 Bytes

Laravel Example application playing with custom middleware and app containers in testing

This was done using Laravel 5.8 but is easily portable to newer versions.

This is an exercise to scratch an itch and to respond to a Laracasts thread, feel free to use it as a jumping point for something magical!!!

Classes that make this happen

Class Purpose
App\CustomState A simple object that adds checks on the authenticated user.
App\Http\Middleware\UserOnboarding Our custom middleware that uses the CustomState class to check that a user needs onboarding.
App\Providers\AppServiceProvider Where we register our singleton instance of CustomState
App\Http\Kernel Where we register our custom middleware.