@php $requestExampleLangs = [ (object)[ 'label' => 'JavaScript', 'lang' => 'JavaScript', ], ]; $includeCurl = true; // COMENTAR ESTA LÍNEA EN PRODUCCIÓN! if(isset($includeCurl) && $includeCurl === true) { $unshift = (object)[ 'label' => 'Curl (verbose)', 'lang' => 'Curl', ]; array_unshift($requestExampleLangs, $unshift); $unshift = (object)[ 'label' => 'Curl (shorthand)', 'lang' => 'Curl-Shorthand', ]; array_unshift($requestExampleLangs, $unshift); } // if(!isset($requestJSONBody) || $requestJSONBody === '') // array_unshift($requestExampleLangs, 'URL'); $codeTabWidth = round(100 / (count($requestExampleLangs)), 8); $exampleCodeParams = array( 'requestURL' => $requestURL, ); if(isset($requestJSONBody) && !empty($requestJSONBody)) $exampleCodeParams['requestJSONBody'] = $requestJSONBody; if(isset($userToken) && !empty($userToken)) $exampleCodeParams['userToken'] = $userToken; if(isset($httpMethod) && !empty($httpMethod)) $exampleCodeParams['httpMethod'] = $httpMethod; $issetExample = $example ?? true; $requestHtmlHeading = $issetExample ? 'Example request' : 'Request'; $responseHtmlHeading = $issetExample ? 'Example response' : 'Response'; // dd($codeTabWidth); @endphp

{{ $requestHtmlHeading }}

@foreach($requestExampleLangs as $ind => $exampleLang) @if($ind === 0) @else @endif @endforeach
@foreach($requestExampleLangs as $ind => $exampleLang) @if($ind !== 0)

{{ $responseHtmlHeading }}

            {{ json_decode(json_encode($functionExampleResponse)) ?? '(Empty response)' }}