title: Laravel Passport post route test on postman
body: <p>I set up Laravel Passport and started to create a few Get routes to get some data, that worked fine. </p>
  
  <p>Now I am trying to post to get on auth token, which currently does not work:</p>
  
  <p>This is my route which I call (Get route works, Post route does not work):</p>
  
  <pre><code>Route::group(['middleware' =&gt; 'auth:api'], function ()
  {;
      Route::get('users', ['as' =&gt; 'users', 'uses' =&gt; 'ApiController@users']);
      Route::post('login/{id}/{name}', ['as' =&gt; 'login', 'uses' =&gt; 'ApiController@login']);
  });
  </code></pre>
  
  <p>The method in my ApiController looks currently like this:</p>
  
  <pre><code>public function login(Request $request, $id, $name)
  {
      if($request-&gt;isMethod('post'))
      {
          $id   = $request-&gt;id;
          $name = $request-&gt;name;
  
          $inquiry = new Inquiry();
          $inquiry-&gt;user_id = $id;
          $inquiry-&gt;user_name = $name;
  
          if($inquiry-&gt;save())
          {
              return redirect()-&gt;route('inquiry.index')-&gt;with('success', 'Success.');
          }
          else
          {
              return redirect()-&gt;route('inquiry.index')-&gt;with('error', 'An error accured.')-&gt;withInput();
          }
      }
      else
      {
          dd("Use Post.");
      }
  }
  </code></pre>
  
  <p>I tried to call it with following options<a href="https://i.stack.imgur.com/DTmih.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DTmih.png" alt="enter image description here"></a>:</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I somehow managed to get this work after many hours, but still dont understand something.</p>
  
  <p>First I did following:</p>
  
  <pre><code>public function callback(Request $request)
  {
      dd($request-&gt;code) // this holds a token I need for the code parameter in the post 
  ...
  </code></pre>
  
  <p>With that I could get the token for the code parameter, but I think there is a better way to do that.</p>
  
  <p>And finally this is now how I get the access + refresh token:</p>
  
  <p><a href="https://i.stack.imgur.com/odiAs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/odiAs.png" alt="enter image description here"></a></p>
  
  <p>But there has to be a better way to get the code token of the callback request ($request->code), instead of dumping it and copying it.</p>