title: Laravel, passing a token from controller to view
body: <p>I'm confused as to why this isn't working properly here. In this controller, I'm hitting an API endpoint which, when successful, gives me back an array of tokens. Here, I'm setting one of those tokens to the accessToken variable and trying to pass that to the view to be used in another call there</p>
  
  <p>Controller.php</p>
  
  <pre><code>$initialLogin = $authService-&gt;initialLogin($newPhone,$request-&gt;temp_password,$request-&gt;email,$request-&gt;password_confirmation);
  
  //this dump and die successfully dumps the token array, so I know I'm getting my tokens
  dd($initialLogin);
  
  //Here I'm setting the variable to one of the specific tokens
  $accessToken = $initialLogin-&gt;auth_access_token;
  
  //Now I'm redirecting to a view, which I'm successfully shown
  return redirect(route('auth.phone'))-&gt;with('accessToken',$accessToken);
  </code></pre>
  
  <p>When the process is done, after testing the dump and die which does show my tokens, then it redirects me successfully to my view. The problem here is that when dumping the variable on the view, it shows null</p>
  
  <p>view.php</p>
  
  <pre><code>&lt;?php dd($accessToken)?&gt;
  </code></pre>
  
  <p>What's going on with this? I can verify that dumping <code>$initialLogin</code> in my controller shows the tokens, and I can verify that <code>$accessToken</code> is set to the specific token I need, so why isn't it properly passed?</p>