user(); $result = $this->impersonationService->start($admin, $user); return $this->success([ 'token' => $result['token'], 'user' => new AdminUserResource($result['user']->load('organisations')), 'admin_id' => $result['admin_id'], ]); } public function stop(): JsonResponse { /** @var User $currentUser */ $currentUser = auth()->user(); $admin = $this->impersonationService->stop($currentUser); return $this->success([ 'user' => new AdminUserResource($admin->load('organisations')), ]); } }