title: URL Parameter in GET Route Laravel
body: <p>I have a route in <code>api.php</code> which look like this</p>
  
  <pre><code>Route::get('auth/logout/{token}', 'UserController@logout');
  </code></pre>
  
  <p>Then, I used Postman to check this API endpoint like this:</p>
  
  <p><code>localhost:8000/api/v1/auth/logout?token=$2y$10$InjSk8VExH76wSyA3OE9a.jhR/3GhAkJdBE3EyQ3O.Z0kCe/r7wp</code>y</p>
  
  <p>But I just get a blank response in postman. It should show the message response and delete the data in the database. But it doesn't. Here is my <code>logout()</code> in <code>UserController.php</code></p>
  
  <pre><code>public function logout($token){
      $current_token = Token::where('token', $token)-&gt;first();
      if($current_token){
          if(Token::where('token','=',$current_token)-&gt;delete()){
              return response()-&gt;json([
                  'message' =&gt; 'Logout Success'
              ], 201);
          }
      }else{
          return response()-&gt;json([
              'message' =&gt; 'Unauthorized User'
          ], 401);
      }
  }
  </code></pre>
  
  <p>Anyone can help my problem? I appreciate all of your approaches.</p>
  
  <p>Edit...</p>
  
  <p>When I send the dummy request like this and use <code>dd($token)</code>, Postman gives me <code>"asdfasdf"</code>.</p>
  
  <pre><code>localhost:8000/api/v1/auth/logout/asdfasdf
  </code></pre>
  
  <p>So, how do I send the <code>token</code> parameter in the URL using <code>"?"</code></p>
  
  <p>Edit 2...</p>
  
  <p>I generate the token from bcrypted <code>user_id</code> from the database. In my case, I don't use any token generator plugin, or something else.</p>