find() public method

public find ( $accountId, $filter = null )
 /**
  * @param $accountId
  * @return \Illuminate\Http\JsonResponse
  */
 public function getDatatable($accountId, $search)
 {
     $datatable = new ProductDatatable(true);
     $query = $this->productRepo->find($accountId, $search);
     if (!Utils::hasPermission('view_all')) {
         $query->where('products.user_id', '=', Auth::user()->id);
     }
     return $this->datatableService->createDatatable($datatable, $query);
 }
 /**
  * @param $accountId
  * @return \Illuminate\Http\JsonResponse
  */
 public function getDatatable($accountId)
 {
     $datatable = new ProductDatatable(false);
     $query = $this->productRepo->find($accountId);
     return $this->datatableService->createDatatable($datatable, $query);
 }