// config/config.php 'formats' => [ 'json' => App\Customizes\ResponseFormat\JsonResponseFormat::class, ]
Step 2 :
// app/Customizes/ResponseFormat/JsonResponseFormat.php
namespace App\Customizes\ResponseFormat;
class JsonResponseFormat extends \Dingo\Api\Http\Response\Format\Json { /** * Encode the content to its JSON representation. * * @param string $content * @return string */ protected function encode($content) { return json_encode($content, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); } }
from : https://github.com/dingo/api/issues/143
沒有留言:
張貼留言