title: Undefined variable error while calling a field in another method
body: <p>I'm trying to set a value for a field in a method and get the value in another method in larvel controller as the following the code.</p>
  
  <pre><code>class LoginController extends Controller {
  
      public $authUser;
  
      public function __construct()
      {
          $this-&gt;authUser = null;
      }
  
  
      public function methodA()
      {
           // some code to get the $response
           $this-&gt;authUser = $response;
      }
  
  
      public function methodB()
      {
           var_dump($this-&gt;authUser);
      }
  }
  </code></pre>
  
  <p>But I got the following error:</p>
  
  <p><strong>(1/1) ErrorException
  Undefined variable: authUser</strong></p>
  
  <p>why it is happen. I could not figure what's happen on my site. </p>