clientRepo = $clientRepo; $this->ninjaRepo = $ninjaRepo; $this->datatableService = $datatableService; } protected function getRepo() { return $this->clientRepo; } public function save($data, $client = null) { if (Auth::user()->account->isNinjaAccount() && isset($data['plan'])) { $this->ninjaRepo->updatePlanDetails($data['public_id'], $data); } return $this->clientRepo->save($data, $client); } public function getDatatable($search, $userId) { $datatable = new ClientDatatable(); $query = $this->clientRepo->find($search, $userId); return $this->datatableService->createDatatable($datatable, $query); } }