When I use livewire The problem is that when selecting from select it has ware:model, the slider crashes, and when you click on search, it shows 404
I tried many times but I don't know why
//my view
div class="ne-sidebar sidebar-break-lg col-xl-4 col-lg-12 px-0">
<div class="sidebar-box item-box-light-md">
<div class="topic-border color-cinnabar mb-30">
<div class="topic-box-lg color-cinnabar"> </div>
</div>
<div class="bodyimg">
<form action="" method="post" name="dmarticlesFilter" id="dmarticlesFilter">
@csrf
<div id="dmarticlesfilter_filters">
<div class="dmarticlesfilter_filters_row">
<select id="filterCategory634bd4c1cb9b5_0" wire:model="fcategory_id">
<option></option>
@foreach($firstcategories as $fcat)
<option value=""></option>
@endforeach
</select>
<select id="filterCategory634bd4c1cb9b5_1" wire:model="scategory_id">
<option></option>
@foreach($secondcategories as $scat)
<option value=""></option>
@endforeach
</select>
</div>
<div class="dmarticlesfilter_filters_values_l">
<input placeholder="Title" type="text" name="filterTitle" value="">
<span><input type="submit" class="button" id="button" value=""> </span>
<a > </a>
</div>
</div>
</form>
</a>
</div>
</div>
//my controller
<?php
class HomeComponent extends Component
{
public $fcategory_id;
public $scategory_id;
public $tcategory_id;
public function render()
{
/***************************** */
$firstcategories = firstcategory::all();
$secondcategories = secondcategory::where('fcategory_id',$this->fcategory_id)->get();
$thirdcategories = thirdcategory::where('scategory_id',$this->scategory_id)->get();
$fourthcategories = fourthcategory::where('tcategory_id',$this->tcategory_id)->get();
return view('livewire.home-component',['fourthcategories'=>$fourthcategories,'thirdcategories'=>$thirdcategories,'secondcategories'=>$secondcategories,'firstcategories'=>$firstcategories])->layout('layouts.base');
}
}
I think the problem is with livewire with wire:model
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire