title: Apply global scope based on user role in Laravel 5.5
body: <p>For some model, I need to apply a global scope if the logged in user is not super admin. In model's <code>boot()</code> method I tried something like this:</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Auth;
  use App\Scopes\RoleScope;
  use Illuminate\Database\Eloquent\Model;
  
  class MyModel extends Model
  {
      protected static function boot()
      {
          parent::boot();
  
          if( Auth::check() &amp;&amp; ! Auth::user()-&gt;isSuperAdmin() ){
              static::addGlobalScope(new RoleScope);
          }
      }
  }
  </code></pre>
  
  <p>The scop never applied! What did I do wrong here? How can I achieve the goal to apply the scope based on the user role? thanks</p>