title: LARAVEL 9 - Get User ID for user management
body: <p>I'm creating a users management with Laravel 9, I am an administrator and I would like to change users to admins whenever I like :)</p>
  <p>For example this user -&gt;</p>
  <p><a href="https://i.stack.imgur.com/6jnBG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6jnBG.png" alt="enter image description here" /></a></p>
  <p>I wrote this code -&gt;</p>
  <pre><code>        public function UpdateToAdminAction(Request $request) {
  
          $request-&gt;validate([
              'type' =&gt; 'required|exists:users',
          ]);
  
          DB::table('users')-&gt;update(
              ['type' =&gt; $request-&gt;type]
          );
  
          return redirect('/gestion-administrateurs');
      }
  </code></pre>
  <p>But I cannot update THIS user's type, this code changes ALL users' types lol, it's not what I wanted. Do you know with this code, how can I change THIS user's type ?</p>
  <p>Thanks, I hope you'll understand my request ^^</p>