Restricting routes based on roles is a handy feature to have. An easy way to acheive this is using a middleware that checks the user’s role to decide if they have access to it. In this post we will go over creating a middleware to allow us to restrict routes to specific roles.
**This assumes you already have Laravel installed on your machine and know how to create a basic application using it**
Let’s get started.