title: Laravel roles with Spatie package
body: <p>How can I set a rule to user to prevent him entering specific route?</p>
  <p>I added a column to permissions table name route and enter routes manually and I made a middleware but the problem is that all my controllers are resource so there is a lot of routes, so what is the best practice to do that?</p>
  <pre><code>public function handle($request, Closure $next)
  {
      $routeName = $request-&gt;route()-&gt;getName();  //users.create
      $permission = Permission::whereRaw(&quot;FIND_IN_SET('$routeName',routes)&quot;)-&gt;first();  //find route
      if($permission)
      {
          if(!$request-&gt;user()-&gt;can($permission-&gt;name))
          {
              abort(403);
          }
      }
      return $next($request);
  }
  </code></pre>