getFileResponse($tags); } /** * Get the response from the file if available. * * @param array $tags * * @return mixed */ protected function getFileResponse(array $tags) { $responseFileTags = array_filter($tags, function ($tag) { return $tag instanceof Tag && strtolower($tag->getName()) == 'responsefile'; }); if (empty($responseFileTags)) { return; } $responseFileTag = array_first($responseFileTags); $json = json_decode(file_get_contents(storage_path($responseFileTag->getContent()), true), true); return response()->json($json); } }