Ahmed Khan wrote a nice tutorial on how to work with Controllers and Middleware in Laravel 5.5.

Laravel middleware