title: Laravel 8: sending request data between classes
body: <p>I'm having a hard time sending input data between classes.</p>
  <p>I have a class with a method that recieves a text input fields data that works normally:</p>
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\postCode_related;
  
  use App\Http\Controllers\Controller;
  use Illuminate\Http\Request;
  use App\Http\Requests\estate_agent_related\validation\branch_checkVal;
  
  
  class postCode_input extends Controller
  {
      public function retrieve(branch_checkVal $request)
      {
          $validated = $request-&gt;validated();
          $user_input_postcode = $request-&gt;input('brach_postcode');
          $postcode = str_replace(' ', '', $user_input_postcode);
          return $postcode;
      }
  }
  </code></pre>
  <p>I have another class that has a method that extends the class above, howver, i can't figure out how to send the input data to the class method above via the class below:</p>
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\postCode_related;
  
  use App\Http\Controllers\Controller;
  use Illuminate\Http\Request;
  use App\Http\Controllers\postCode_related\postCode_input;
  
  class postCode_check extends postCode_input 
  {
      public function check(postCode_input $postCode_input)
      {
          $postCode_input = new postCode_input;
          return $postCode_input-&gt;retrieve();
          // return Estate_agent::where('postcode', $postCode_input)-&gt;exists();
      }
  }
  </code></pre>
  <p>I hope i've explained this well enough. If not, Please let me know and i'll provide more info.</p>
  <p>Thanks</p>