Sfoglia il codice sorgente

FIX: Fixed "PHP Fatal error: Method Illuminate\View\View::__toString() must not throw an exception" when using with Dingo API.

Rick Sharp 8 anni fa
parent
commit
e24a1a1f53
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      src/resources/views/documentarian.blade.php

+ 4 - 0
src/resources/views/documentarian.blade.php

@@ -66,7 +66,11 @@ console.log(response);
 > Example response:
 
 ```json
+@if(is_object($parsedRoute['response']) || is_array($parsedRoute['response']))
+{!! json_encode($parsedRoute['response'], JSON_PRETTY_PRINT) !!}
+@else
 {!! json_encode(json_decode($parsedRoute['response']), JSON_PRETTY_PRINT) !!}
+@endif
 ```
 @endif