title: Laravel - Share variable between controller functions
body: <p>I'm new to Laravel and working on a simple project where in my controller <strong>(TestController)</strong> i have two functions <strong>(process &amp; show)</strong>. </p>
  
  <p>What i'm trying to do is pass <strong>$email</strong> variable between the functions, so i can use it within the show function, but i don't know how to do that.</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>class TestController extends Controller
  {    
  
      public function process(Request $request){
          if($request-&gt;ajax()) {
              $email = $request-&gt;get( "fullemail" );
          }
      }
  
  
      public function show(){
  
      }
  
  }
  </code></pre>
  
  <p>Any help would be appreciated. Thanks in advance :) </p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>I'm edited my code as followed. Currently i get <code>Too few arguments to function App\Http\Controllers\TestController::show(), 0 passed and exactly 1 expected</code> Error.</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>class TestController extends Controller
  {    
      public function process(Request $request){
          if($request-&gt;ajax()) {
              $email = $request-&gt;get( "fullemail" );
              $this-&gt;show($email);
          }
      }
  
      public function show($email){
          dd($email)
      }
  }
  </code></pre>