Closed rimbaborne closed 4 years ago
I already got the answer in the laravel-livewire.com forum and the code works by using this documentation https://laravel.com/docs/7.x/queries#conditional-clauses. thanks.
public function render()
{
return view('livewire.biodata', [
'biodatas' => \App\Models\Biodatum::when($this->searchproduk, function ($query) {
return $query->where('idprodukreg', '=', $this->searchproduk);
})
->when($this->search, function ($query) {
return $query->where('nama', 'like', '%'.$this->search.'%');
})
->orderBy($this->sortField, $this->sortAsc ? 'asc' : 'desc')
->paginate($this->perPage),
]);
}
Hi. i have an error to adding more filter or multiple search input. I want to ask if there is documentation related to this.
bug
Call to undefined method Illuminate\Database\Eloquent\Builder::search()
how to add filters or multiple search input ?
Desktop