taskRepo = $taskRepo; $this->datatableService = $datatableService; } protected function getRepo() { return $this->taskRepo; } /* public function save() { return null; } */ public function getDatatable($clientPublicId, $search) { $datatable = new TaskDatatable( ! $clientPublicId, $clientPublicId); $query = $this->taskRepo->find($clientPublicId, $search); if(!Utils::hasPermission('view_all')){ $query->where('tasks.user_id', '=', Auth::user()->id); } return $this->datatableService->createDatatable($datatable, $query); } }