class Illuminate / Http / JsonResponse
You are viewing an older version of the documentation. For the latest, please visit master documentation.

JsonResponse

Extends

    Symfony\...\JsonResponse

Uses

Methods

public

__construct ( $data , $status , $headers , $options , $json ) : void

Constructor.

Parameters

  • $data mixed
  • $status int
  • $headers array
  • $options int
  • $json bool
public static

fromJsonString ( string $data , int $status , array $headers ) : static

{@inheritdoc}

public

withCallback ( $callback ) : $this

Sets the JSONP callback.

Parameters

  • $callback string|null
public

getData ( $assoc , $depth ) : mixed

Get the json_decoded data from the response.

Parameters

  • $assoc bool
  • $depth int
public

setData ( $data ) : static

{@inheritdoc}

protected

hasValidJson ( $jsonError ) : bool

Determine if an error occurred during JSON encoding.

Parameters

  • $jsonError int
public

setEncodingOptions ( $options ) : static

{@inheritdoc}

public

hasEncodingOption ( $option ) : bool

Determine if a JSON encoding option is set.

Parameters

  • $option int