laravel where and orwhere query with pagination

  public function SupplierProductReturnSearch(Request $request){

        // Get the search value from the request
        $search = $request->input('search');  
       
        // Search in the title and body columns from the posts table
        $listings = MainProduct::query()
            ->where('name', 'LIKE', "%{$search}%")          
            ->orWhere('product_id', 'LIKE', "%{$search}%")          
            ->paginate(25);
   
        // Return the search view with the resluts compacted
        return view('front.manager.return-supplier-product', compact('listings'));
    }

Comments

Popular posts from this blog

date wise search codeigniter

all customer due sql query