\App\Api\ResponseResponse

API Response class.

Summary

Methods
Properties
Constants
setName()
getName()
toArray()
toJson()
No public properties found
No constants found
getContent()
$success
$content
N/A
assertHasName()
$name
N/A

Properties

$success

$success : boolean

Type

boolean

$content

$content : mixed

Type

mixed

$name

$name : string

Type

string

Methods

setName()

setName(string  $name) 

Parameters

string $name

getName()

getName() : string

Name of this response

Returns

string

toArray()

toArray() : array

Return the data as an array

Returns

array

toJson()

toJson(integer  $options) : string

Return the data as a JSON string

Parameters

integer $options

json_encode options

Returns

string

getContent()

getContent() : mixed

Get response content

Returns

mixed

assertHasName()

assertHasName() 

Ensure that a response name has been set