route.blade.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!-- START_{{$route['id']}} -->
  2. @if($route['title'] != '')## {{ $route['title']}}
  3. @else## {{$route['uri']}}@endif
  4. @if($route['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['description'])
  7. {!! $route['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. @if(is_array($route['response']))
  15. @foreach($route['response'] as $response)
  16. > Example response ({{$response['status']}}):
  17. ```json
  18. @if(is_object($response['content']) || is_array($response['content']))
  19. {!! json_encode($response['content'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) !!}
  20. @else
  21. {!! json_encode(json_decode($response['content']), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) !!}
  22. @endif
  23. ```
  24. @endforeach
  25. @else
  26. > Example response:
  27. ```json
  28. @if(is_object($route['response']) || is_array($route['response']))
  29. {!! json_encode($route['response'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) !!}
  30. @else
  31. {!! json_encode(json_decode($route['response']), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) !!}
  32. @endif
  33. ```
  34. @endif
  35. @endif
  36. ### HTTP Request
  37. @foreach($route['methods'] as $method)
  38. `{{$method}} {{$route['uri']}}`
  39. @endforeach
  40. @if(count($route['bodyParameters']))
  41. #### Body Parameters
  42. Parameter | Type | Status | Description
  43. --------- | ------- | ------- | ------- | -----------
  44. @foreach($route['bodyParameters'] as $attribute => $parameter)
  45. {{$attribute}} | {{$parameter['type']}} | @if($parameter['required']) required @else optional @endif | {!! $parameter['description'] !!}
  46. @endforeach
  47. @endif
  48. @if(count($route['queryParameters']))
  49. #### Query Parameters
  50. Parameter | Status | Description
  51. --------- | ------- | ------- | -----------
  52. @foreach($route['queryParameters'] as $attribute => $parameter)
  53. {{$attribute}} | @if($parameter['required']) required @else optional @endif | {!! $parameter['description'] !!}
  54. @endforeach
  55. @endif
  56. <!-- END_{{$route['id']}} -->