public function handler(Request $request) { info($request->json()->all()); $alexaRequest = AlexaRequest::fromData($request->json()->all()); info(print_r($alexaRequest, true)); if ($alexaRequest instanceof IntentRequest) { $intent = $this->getIntent($alexaRequest->intentName); $alexaResponse = $intent->handle($alexaRequest); } elseif ($alexaRequest instanceof LaunchRequest) { try { $appName = $this->getAppNameFromId($alexaRequest->applicationId); $intent = $this->getIntent($appName . 'HelpIntent'); $alexaResponse = $intent->handle($alexaRequest); } catch (RuntimeException $e) { // Default response $alexaResponse = new AlexaResponse(); $alexaResponse->respond('How can I help you?')->reprompt('What do you want to do?'); } } else { $alexaResponse = new AlexaResponse(); } return response()->json($alexaResponse->render()); }