App\services\ProductService::getDatatable PHP Method

getDatatable() public method

public getDatatable ( $accountId, $search ) : Illuminate\Http\JsonResponse
$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);
    }

Usage Example

 /**
  * @return \Illuminate\Http\JsonResponse
  */
 public function getDatatable()
 {
     return $this->productService->getDatatable(Auth::user()->account_id, Input::get('sSearch'));
 }
All Usage Examples Of App\services\ProductService::getDatatable