title: Laravel 5: Post - Pass Arguments To Controller
body: <p>I think what I want is quite basic, I just can't find the proper syntax as I am still learning Laravel.</p>
  
  <p>So, I am using google verification for sign ins on my website. This entails a post request to my backend that has to be handled, I have put this logic in a controller. My routes.php:</p>
  
  <pre><code>Route::post('google' ,  [
      'as' =&gt; 'verify.index',
      'uses' =&gt; 'verify@verifyIdToken'
  ]);
  </code></pre>
  
  <p>My controller (verify.php):</p>
  
  <pre><code>&lt;?php
  namespace App\Http\Controllers;
  use App\Http\Controllers\Controller;
  
  class verify extends Controller
  {
      public function verifyIdToken($token)
      {
          $token = $_POST['id'];
          $email = $_POST['email'];
          return $this-&gt;getAuth()-&gt;verifyIdToken($token);
          echo $this-&gt;getAuth()-&gt;verifyIdToken($token);
          return view('aviewII')-&gt;with(['verify' =&gt; json_encode(verifyIdToken($token)),'email'=&gt; json_encode($email)]);
      }
  }
  </code></pre>
  
  <p>Of course, because of how the function in the controller is written, I get the following error <code>Missing argument 1 for App\Http\Controllers\verify::verifyIdToken()</code> My question is, how do I tell the function in the controller to take <code>$_POST['id']</code> as the argument for <code>$token</code>?</p>
  
  <p>Something like this:</p>
  
  <pre><code>Route::post('google' ,  [
          'as' =&gt; 'verify.index',
          'uses' =&gt; 'verify@verifyIdToken ~with $_POST['id'] as $token'
      ]);
  </code></pre>
  
  <p>For additional reference, my actual post request looks like this:</p>
  
  <p><code>$.post( "http://example.com/google", {email:profile.getEmail(),id:id_token} );</code></p>