title: Passing values within a multi-step form using Laravel 8 and Livewire 2.7
body: <p>I have a multi-step form where a user can add cars to their profile.  The first step is where the car is created and the relationship is established between the <code>user</code> and <code>usercar</code>.  The first step works as it should, but it doesn't establish and or retain a connection to the <code>usercar</code> in subsequent steps.  I know I am missing an obvious step of hydration or session code, but this is new territory for me.</p>
  <p><strong>AddUserCar.php</strong></p>
  <pre><code>...
  class AddUserCar extends Component
  {
      public $showAnotherModel = false;
  
      // Steps
      public $totalSteps = 8;
      public $step = 1;
      // User
      public $super;
      public $first_name;
      public $last_name;
      public $email;
      public $status = 1;
      public $role = 'Driver';
      // Usercar
      public $car_id;
      public $calc_date;
      // Form Function
      public $car_year;
  
      //public $cars;
      //public $modelId;
  
      public function mount(User $user)
      {
          if(session()-&gt;has('tenant_id')) {
              $this-&gt;super = false;
          } else {
              $this-&gt;super = true;
              $this-&gt;tenants = Tenant::all()-&gt;pluck('first_name', 'id')-&gt;toArray();
          }
  
          $this-&gt;carYears = Car::all()
              -&gt;unique('start_year')
              -&gt;sortByDesc('start_year');
  
          $this-&gt;carModels = Car::all()
              -&gt;unique('start_year')
              -&gt;sortByDesc('start_year');
  
          $this-&gt;getModels();
      }
  
      ...
  
      public function moveAhead()
      {
  
          if($this-&gt;step == 1) {
  
              Usercar::create([
                  'car_id' =&gt; $this-&gt;car_id,
                  'user_id' =&gt; Auth::user()-&gt;id,
                  'tenant_id' =&gt; Auth::user()-&gt;tenant_id,
                  'calc_date' =&gt; now()-&gt;format('m-d-Y'),
              ]);
              dd($this-&gt;calc_date); // this produces an error
              
              $this-&gt;resetErrorBag();
              $this-&gt;resetValidation();
          }
  
          if($this-&gt;step == 2) {
              // Step Code
              $this-&gt;resetErrorBag();
              $this-&gt;resetValidation();
          }
  
          if($this-&gt;step == 3) {
              // Step Code
  
              $this-&gt;resetErrorBag();
              $this-&gt;resetValidation();
          }
          if($this-&gt;step == 4) {
              // Step Code
  
              $this-&gt;resetErrorBag();
              $this-&gt;resetValidation();
          }
          if($this-&gt;step == 5) {
              // Step Code
  
              $this-&gt;resetErrorBag();
              $this-&gt;resetValidation();
          }
          if($this-&gt;step == 6) {
              // Step Code
  
              $this-&gt;resetErrorBag();
              $this-&gt;resetValidation();
          }
          if($this-&gt;step == 7) {
              // Step Code
  
              $this-&gt;resetErrorBag();
              $this-&gt;resetValidation();
          }
  
          if($this-&gt;step == 8) {
              // Step Code
  
              redirect()-&gt;route('dashboard');
          }
  
          //Increase Step
          $this-&gt;step += 1;
          $this-&gt;_validateStep();
      }
  
      public function moveBack()
      {
          $this-&gt;step -= 1;
          $this-&gt;_validateStep();
      }
  
      private function _validateStep()
      {
          if ($this-&gt;step &lt; 1) {
              $this-&gt;step = 1;
          }
  
          if ($this-&gt;step &gt; $this-&gt;totalSteps) {
              $this-&gt;step = $this-&gt;totalSteps;
          }
      }
  
      public function render()
      {
          return view('livewire.add-user-car',
          ['pageTitle' =&gt; 'Add Driver Car']);
      }
  }
  </code></pre>