class Response (View source)

Traits

Properties

static protected array $macros The registered string macros. from MacroableTrait

Methods

static void
macro(string $name, callable $macro)

Register a custom macro.

static boolean
hasMacro(string $name)

Checks if macro is registered

static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

mixed
__call(string $method, array $parameters)

Dynamically handle calls to the class.

static Response
make(string $content = '', int $status = 200, array $headers = array())

Return a new response from the application.

static Response
view(string $view, array $data = array(), int $status = 200, array $headers = array())

Return a new view response from the application.

static JsonResponse
json(string|array $data = array(), int $status = 200, array $headers = array(), int $options = 0)

Return a new JSON response from the application.

static JsonResponse
jsonp(string $callback, string|array $data = [], int $status = 200, array $headers = [], int $options = 0)

Return a new JSONP response from the application.

static StreamedResponse
stream(Closure $callback, int $status = 200, array $headers = array())

Return a new streamed response from the application.

static BinaryFileResponse
download(SplFileInfo|string $file, string $name = null, array $headers = array(), null|string $disposition = 'attachment')

Create a new file download response.

Details

static void macro(string $name, callable $macro)

Register a custom macro.

Parameters

string $name
callable $macro

Return Value

void

static boolean hasMacro(string $name)

Checks if macro is registered

Parameters

string $name

Return Value

boolean

static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

static Response make(string $content = '', int $status = 200, array $headers = array())

Return a new response from the application.

Parameters

string $content
int $status
array $headers

Return Value

Response

static Response view(string $view, array $data = array(), int $status = 200, array $headers = array())

Return a new view response from the application.

Parameters

string $view
array $data
int $status
array $headers

Return Value

Response

static JsonResponse json(string|array $data = array(), int $status = 200, array $headers = array(), int $options = 0)

Return a new JSON response from the application.

Parameters

string|array $data
int $status
array $headers
int $options

Return Value

JsonResponse

static JsonResponse jsonp(string $callback, string|array $data = [], int $status = 200, array $headers = [], int $options = 0)

Return a new JSONP response from the application.

Parameters

string $callback
string|array $data
int $status
array $headers
int $options

Return Value

JsonResponse

static StreamedResponse stream(Closure $callback, int $status = 200, array $headers = array())

Return a new streamed response from the application.

Parameters

Closure $callback
int $status
array $headers

Return Value

StreamedResponse

static BinaryFileResponse download(SplFileInfo|string $file, string $name = null, array $headers = array(), null|string $disposition = 'attachment')

Create a new file download response.

Parameters

SplFileInfo|string $file
string $name
array $headers
null|string $disposition

Return Value

BinaryFileResponse