Property | Type | Description | |
---|---|---|---|
$exception | Exception | The exception that triggered the error response. |
Property | Type | Description | |
---|---|---|---|
$binding | Dingo\Api\Transformer\Binding | Transformer binding instance. | |
$events | Illuminate\Events\Dispatcher | Event dispatcher instance. | |
$formatters | array | Array of registered formatters. | |
$transformer | Dingo\Api\Transformer\TransformerFactory | Transformer factory instance. |
Method | Description | |
---|---|---|
__construct ( mixed $content, integer $status = 200, array $headers = [], Dingo\Api\Transformer\Binding $binding = null ) : void | Create a new response instance. | |
addFormatter ( string $key, Dingo\Api\Http\Response\Format\Format $formatter ) : void | Add a response formatter. | |
addMeta ( string $key, mixed $value ) : |
Add a meta key and value pair. | |
cookie ( |
Add a cookie to the response. | |
getFormatter ( string $format ) : Dingo\Api\Http\Response\Format\Format | Get the formatter based on the requested format type. | |
getMeta ( ) : array | Get the meta data for the response. | |
getTransformer ( ) : Dingo\Api\Transformer\Factory | Get the transformer instance. | |
hasFormatter ( string $format ) : boolean | Determine if a response formatter has been registered. | |
makeFromExisting ( Illuminate\Http\Response $old ) : |
Make an API response from an existing Illuminate response. | |
makeFromJson ( Illuminate\Http\JsonResponse $json ) : |
Make an API response from an existing JSON response. | |
meta ( string $key, mixed $value ) : |
Add a meta key and value pair. | |
morph ( string $format = 'json' ) : |
Morph the API response to the appropriate format. | |
setContent ( $content ) | ||
setEventDispatcher ( Illuminate\Events\Dispatcher $events ) : void | Set the event dispatcher instance. | |
setFormatters ( array $formatters ) : void | Set the response formatters. | |
setMeta ( array $meta ) : |
Set the meta data for the response. | |
setTransformer ( Dingo\Api\Transformer\Factory $transformer ) : void | Set the transformer factory instance. | |
statusCode ( integer $statusCode ) : |
Set the response status code. | |
withHeader ( string $key, string $value, boolean $replace = true ) : |
Add a header to the response. |
Method | Description | |
---|---|---|
fireMorphedEvent ( ) : void | Fire the morphed event. | |
fireMorphingEvent ( ) : void | Fire the morphing event. |
public static addFormatter ( string $key, Dingo\Api\Http\Response\Format\Format $formatter ) : void | ||
$key | string | |
$formatter | Dingo\Api\Http\Response\Format\Format | |
return | void |
protected fireMorphedEvent ( ) : void | ||
return | void |
protected fireMorphingEvent ( ) : void | ||
return | void |
public static getFormatter ( string $format ) : Dingo\Api\Http\Response\Format\Format | ||
$format | string | |
return | Dingo\Api\Http\Response\Format\Format |
public static getTransformer ( ) : Dingo\Api\Transformer\Factory | ||
return | Dingo\Api\Transformer\Factory |
public static hasFormatter ( string $format ) : boolean | ||
$format | string | |
return | boolean |
public static makeFromExisting ( Illuminate\Http\Response $old ) : |
||
$old | Illuminate\Http\Response | |
return |
public static makeFromJson ( Illuminate\Http\JsonResponse $json ) : |
||
$json | Illuminate\Http\JsonResponse | |
return |
public static setEventDispatcher ( Illuminate\Events\Dispatcher $events ) : void | ||
$events | Illuminate\Events\Dispatcher | |
return | void |
public static setFormatters ( array $formatters ) : void | ||
$formatters | array | |
return | void |
public static setTransformer ( Dingo\Api\Transformer\Factory $transformer ) : void | ||
$transformer | Dingo\Api\Transformer\Factory | |
return | void |
public statusCode ( integer $statusCode ) : |
||
$statusCode | integer | |
return |
protected Binding,Dingo\Api\Transformer $binding | ||
return | Dingo\Api\Transformer\Binding |
protected static Dispatcher,Illuminate\Events $events | ||
return | Illuminate\Events\Dispatcher |
public Exception $exception | ||
return | Exception |
protected static array $formatters | ||
return | array |