In this video we are going to learn about Add Search on Admin Products Page.
So let see how can we Add Search on Admin Products Page.
Switch to the project and lets open the AdminProductComponent view file
And here lets add here input text field


<div class="col-md-4">
<input type="text" class="form-control" wire:model="searchTerm" placeholder="Search..." />
</div>


Now go to the AdminProductComponent class file and here lets create a property


public $searchTerm;


Now lets bind this property to the input text field.
so go to the view file and here just write wire:model="searchTerm"
Now go to the class file and here
Inside the render method add the following code


public function render()
{
$search = '%' . $this->searchTerm . '%';
$products = Product::where('name','LIKE',$search)
->orWhere('stock_status','LIKE',$search)
->orWhere('regular_price','LIKE',$search)
->orWhere('sale_price','LIKE',$search)
->orderBy('id','DESC')->paginate(10);
return view('livewire.admin.admin-product-component',['products'=>$products])->layout('layouts.base');
}


Now its done, so lets check
So switch to the browser and refresh the page
Now lets search product by name so write here
And here you can see the search result
If I enter here the price
You can see here the products which price is matching.
So in this way you can Add Search on Admin Products Page.