route.blade.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!-- START_{{$route['id']}} -->
  2. @if($route['metadata']['title'] != '')## {{ $route['metadata']['title']}}
  3. @else## {{$route['uri']}}@endif
  4. @if($route['metadata']['authenticated'])
  5. <br><small style="padding: 1px 9px 2px;font-weight: bold;white-space: nowrap;color: #ffffff;-webkit-border-radius: 9px;-moz-border-radius: 9px;border-radius: 9px;background-color: #3a87ad;">Requires authentication</small>@endif
  6. @if($route['metadata']['description'])
  7. {!! $route['metadata']['description'] !!}
  8. @endif
  9. > Example request:
  10. @foreach($settings['languages'] as $language)
  11. @include("apidoc::partials.example-requests.$language")
  12. @endforeach
  13. @if(in_array('GET',$route['methods']) || (isset($route['showresponse']) && $route['showresponse']))
  14. @foreach($route['responses'] as $response)
  15. > Example response ({{$response['status']}}):
  16. ```json
  17. @if(is_object($response['content']) || is_array($response['content']))
  18. {!! json_encode($response['content'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) !!}
  19. @else
  20. {!! json_encode(json_decode($response['content']), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) !!}
  21. @endif
  22. ```
  23. @endforeach
  24. @endif
  25. ### HTTP Request
  26. @foreach($route['methods'] as $method)
  27. `{{$method}} {{$route['uri']}}`
  28. @endforeach
  29. @if(count($route['urlParameters']))
  30. #### URL Parameters
  31. Parameter | Status | Description
  32. --------- | ------- | ------- | -------
  33. @foreach($route['urlParameters'] as $attribute => $parameter)
  34. {{$attribute}} | @if($parameter['required']) required @else optional @endif | {!! $parameter['description'] !!}
  35. @endforeach
  36. @endif
  37. @if(count($route['queryParameters']))
  38. #### Query Parameters
  39. Parameter | Status | Description
  40. --------- | ------- | ------- | -----------
  41. @foreach($route['queryParameters'] as $attribute => $parameter)
  42. {{$attribute}} | @if($parameter['required']) required @else optional @endif | {!! $parameter['description'] !!}
  43. @endforeach
  44. @endif
  45. @if(count($route['bodyParameters']))
  46. #### Body Parameters
  47. Parameter | Type | Status | Description
  48. --------- | ------- | ------- | ------- | -----------
  49. @foreach($route['bodyParameters'] as $attribute => $parameter)
  50. {{$attribute}} | {{$parameter['type']}} | @if($parameter['required']) required @else optional @endif | {!! $parameter['description'] !!}
  51. @endforeach
  52. @endif
  53. <!-- END_{{$route['id']}} -->