title: use multi dropdown dependency in laravel 8 with livewire
body: <p>use dropdown(select input) with dependency very simple with livewire.</p>
  <p>we have 2 models.
  state and city</p>
  <p>in case we want when state dropdown has been selected by user , city dropdown shown and user can select cities without using ajax or java scripts jut with livewire
  just with livewire in laravel 8.</p>
  <p>install livewire in your laravel project</p>
  <p><code>composer require livewire/livewire </code></p>
  <p>create your component (example name counter)</p>
  <p><code>php artisan make:livewire counter</code></p>
  <p>Running this command will generate the following two files:</p>
  <p>app/Http/Livewire/Counter.php</p>
  <p>resources/views/livewire/counter.blade.php</p>
  <p>livewire class Counter.php==&gt;</p>
  <pre><code>namespace App\Http\Livewire;
  
  use Livewire\Component;
  
  class Counter extends Component
  {
      public $first,$second;
  
      public function render()
      {
          
          return view('livewire.Counter');
      }
  }
  </code></pre>
  <p>livewire blade counter.blade.php like this==&gt;</p>
  <pre><code>&lt;div&gt;
      &lt;select wire:model='first' name=&quot;1&quot; id=&quot;1&quot;&gt;
          &lt;option value=&quot;&quot;&gt;select&lt;/option&gt;
          &lt;option value=&quot;volvo&quot;&gt;Volvo&lt;/option&gt;
          &lt;option value=&quot;saab&quot;&gt;Saab&lt;/option&gt;
          &lt;option value=&quot;mercedes&quot;&gt;Mercedes&lt;/option&gt;
          &lt;option value=&quot;audi&quot;&gt;Audi&lt;/option&gt;
        &lt;/select&gt;
        @if($first)
        &lt;select  wire:model='second' name=&quot;2&quot; id=&quot;2&quot;&gt;
          &lt;option value=&quot;&quot;&gt;select&lt;/option&gt;
          &lt;option value=&quot;1&quot;&gt;1&lt;/option&gt;
          &lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;
          &lt;option value=&quot;3&quot;&gt;3&lt;/option&gt;
          &lt;option value=&quot;4&quot;&gt;4&lt;/option&gt;
        &lt;/select&gt;
        @endif
  &lt;/div&gt;
  </code></pre>
  <p>use our component in every blade you want.in case we put it on welcom.blade.php</p>
  <pre><code>&lt;head&gt;
      ...
      @livewireStyles
  &lt;/head&gt;
  &lt;body&gt;
      &lt;livewire:counter /&gt; 
   
      ...
   
      @livewireScripts
  &lt;/body&gt;
  </code></pre>
  <p>Have fun.If have a better idea share it please.</p>