Middleware that allows admin ONLY to delete record in Laravel 5

Step1: Create new middleware

Lets create new Middleware named ‘DeleteIfAdmin‘. In the console type:

A new file will be created in the Middleware folder. By default, the code below will also generated. It handles all the HTTP request that your app will generate in the handle() function.

Sharing is caring!