Laravel: Middleware (Custom Auth Service)

First, run in terminal php artisan make:middleware EnsureUserHasRole

Then, open, add code below

In, add middleware in route

Next, open, and paste code below

Done.