tokenRepo = $tokenRepo; $this->datatableService = $datatableService; } /** * @return TokenRepository */ protected function getRepo() { return $this->tokenRepo; } /** * @param $userId * * @return \Illuminate\Http\JsonResponse */ public function getDatatable($userId) { $datatable = new TokenDatatable(false); $query = $this->tokenRepo->find($userId); return $this->datatableService->createDatatable($datatable, $query); } }