title: How to pass value/variable from one function to another in Livewire- Laravel
body: <p>I am doing a multiple dropdown, but in the last select it does not show the information of the query in updatedSelectedYear, how can I pass the values ​​of $ models, $ master and% year to the function updatedSelectedYear? The query works on the on mount function but not on updatedSelectedYear.</p>
  <pre><code>&lt;?php
  
  namespace App\Http\Livewire;
  
  use Livewire\Component;
  use App\Models\Cotizaciones;
  use App\Models\Vehiculo;
  use App\Models\Stockokm;
  use App\Models\Master;
  use App\Models\Modelo;
  use App\Models\Marca;
  use App\Models\User;
  use Livewire\WithPagination;
  use App\Models\Linlpv;
  use Illuminate\Support\Facades\DB;
  
  
  class Cotizador extends Component
  {
  
      public $marcas;
      public  $modelos;
      public  $masters;
      public  $years;
      public  $chassis;
  
  
      public $selectedMarca = '';
      public $selectedModelo = NULL;
      public $selectedMaster = NULL;
      public $selectedYear = NULL;
      public $selectedChasis = NULL;
  
      public function mount()
       {
  
           $this-&gt;marcas = Marca::where('es_para_cotizador', '=', 'S')-&gt;get();
           $this-&gt;modelos = collect();
           $this-&gt;masters = collect();
           $this-&gt;years = collect();
           $this-&gt;chassis = collect(); 
       }
      
      public function render()
      {
         
          
          return view('livewire.cotizador');
      }
  
      
      public function updatedSelectedMarca($marca)
      { 
         $this-&gt;modelos = Modelo::where('cod_marca', $marca )
        -&gt;get();
          
      }
  
      public function updatedSelectedModelo($modelos)
       {
          
          $this-&gt;masters = Master::where('cod_modelo', $modelos)
          -&gt;get();
      
           
       }
       public function updatedSelectedMaster($master)
       {
          
         $this-&gt;years =  Linlpv::distinct()
          -&gt;get(['anio'],$master);
  
       }
      
      public function updatedSelectedYear($modelos, $masters,  $years)
       {
  
           $this-&gt;selectedModelo = $modelos;
           $this-&gt;selectedMaster = $masters;
           $this-&gt;selectedYear = $years;
  
          $this-&gt;chassis = Vehiculo::from('ct_vehiculos as v')
          -&gt;join('sa_stockokm as s',function($join){
              $join-&gt;on('v.chassis','=','s.chassis')
              -&gt;where('s.cod_estado','=', 'stock');
          })   
          
             -&gt;where('v.cod_modelo',  $modelos)
             -&gt;where('v.cod_master',  $masters)
             -&gt;where('v.año_modelo',  $years)
             -&gt;select(&quot;*&quot;)
             -&gt;get();
  
             
  
       }
     
  
  }
  </code></pre>
  <p>I am doing a multiple dropdown, but in the last select it does not show the information of the query in updatedSelectedYear, how can I pass the values ​​of $ models, $ master and% year to the function updatedSelectedYear? The query works on the on mount function but not on updatedSelectedYear.</p>