src/ServiceProvider.php
protected function bootResponseMacro()
    {
        Response::macro('jsonApi', function ($api = null) {
            return json_api($api)->getResponses()->withEncodingParameters(
                app(EncodingParametersInterface::class)
            );
        });
    }
protected function bootResponseMacro()
    {
        Response::macro('jsonApi', function ($api = null) {
            return json_api($api)->getResponses()->withEncodingParameters(
                app(EncodingParametersInterface::class)
            );
        });
    }
Register a response macro.

@return void