title: Laravel testing with JWT-Auth
body: <p>I'm trying to test my api that's made with JWT_auth: <a href="https://github.com/tymondesigns/jwt-auth" rel="nofollow">https://github.com/tymondesigns/jwt-auth</a></p>
  
  <pre><code>class UpdateTest extends TestCase
  {
      use DatabaseTransactions;
  
      public $token;
  
      public function signIn($data = ['email'=&gt;'mail@gmail.com', 'password'=&gt;'secret'])
      {
          $this-&gt;post('api/login', $data);
          $content = json_decode($this-&gt;response-&gt;getContent());
          $this-&gt;assertObjectHasAttribute('token', $content);
          $this-&gt;token = $content-&gt;token;
  
          return $this;
      }
  
      /** @test */
      public function a_user_updates_his_account()
      {
          factory(User::class)-&gt;create([
              'name'              =&gt; 'Test',
              'last_name'         =&gt; 'Test',
              'email'             =&gt; 'mail@gmail.com',
              'mobile'            =&gt; '062348383',
              'function'          =&gt; 'ceo',
              'about'             =&gt; 'About me.....',
              'corporation_id'    =&gt; 1
          ]);
  
          $user = User::first();
          $user-&gt;active = 2;
          $user-&gt;save();
  
          $this-&gt;signIn();
  
          $url = '/api/user/' . $user-&gt;slug . '?token=' . $this-&gt;token;
          $result = $this-&gt;json('GET', $url);
          dd($result);
      }
  }
  </code></pre>
  
  <p>Result is always:</p>
  
  <pre><code>The token could not be parsed from the request
  </code></pre>
  
  <p>How do I get this t work!?</p>
  
  <p>Source (<a href="https://github.com/tymondesigns/jwt-auth/issues/206" rel="nofollow">https://github.com/tymondesigns/jwt-auth/issues/206</a>)</p>