title: Laravel Spatie Roles and permissions - error on Update
body: <p>I need help for my Laravel application.</p>
  
  <p>I use spatie roles and permissions.</p>
  
  <p>When i create the user, assign roles is no problem. When i will update the same user, there is the following error:</p>
  
  <blockquote>
    <p>[2019-12-06 08:44:36] local.ERROR: The given role or permission should use guard <code>instead of `web`. {"userId":1,"exception":"[object] (Spatie\\Permission\\Exceptions\\GuardDoesNotMatch(code: 0): The given role or permission should use guard</code> instead of <code>web</code>. at /home/vagrant/code/test/vendor/spatie/laravel-permission/src/Exceptions/GuardDoesNotMatch.php:12)</p>
  </blockquote>
  
  <pre><code>public function store(StoreUserRequest $request)
  {
      $user = $this-&gt;repo-&gt;create( $request-&gt;all());
  
      $user-&gt;assignRole($request-&gt;roles);
  
      return $user;
  }
  
  public function update(UpdateUserRequest $request, User $user)
  {
      $user = $this-&gt;repo-&gt;update($user, $request-&gt;all());
  
      $user-&gt;assignRole($request-&gt;roles);
  
      return $user;
  }
  </code></pre>
  
  <p>I added <code>protected $guard_name = 'web';</code> to the User Model but still the same problem.</p>
  
  <p>What is wrong? Is there a problme with the userId?</p>