interface ResponseFactory (View source)

Methods

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

Return a new response from the application.

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

Return a new view response from the application.

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

Return a new JSON response from the application.

Response
jsonp(string $callback, string|array $data = array(), int $status = 200, array $headers = array(), int $options = 0)

Return a new JSONP response from the application.

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

Return a new streamed response from the application.

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

Create a new file download response.

Response
redirectTo(string $path, int $status = 302, array $headers = array(), bool $secure = null)

Create a new redirect response to the given path.

Response
redirectToRoute(string $route, array $parameters = array(), int $status = 302, array $headers = array())

Create a new redirect response to a named route.

Response
redirectToAction(string $action, array $parameters = array(), int $status = 302, array $headers = array())

Create a new redirect response to a controller action.

Response
redirectGuest(string $path, int $status = 302, array $headers = array(), bool $secure = null)

Create a new redirect response, while putting the current URL in the session.

Response
redirectToIntended(string $default = '/', int $status = 302, array $headers = array(), bool $secure = null)

Create a new redirect response to the previously intended location.

Details

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

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

Response 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

Response

Response jsonp(string $callback, string|array $data = array(), int $status = 200, array $headers = array(), 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

Response

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

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

Response redirectTo(string $path, int $status = 302, array $headers = array(), bool $secure = null)

Create a new redirect response to the given path.

Parameters

string $path
int $status
array $headers
bool $secure

Return Value

Response

Response redirectToRoute(string $route, array $parameters = array(), int $status = 302, array $headers = array())

Create a new redirect response to a named route.

Parameters

string $route
array $parameters
int $status
array $headers

Return Value

Response

Response redirectToAction(string $action, array $parameters = array(), int $status = 302, array $headers = array())

Create a new redirect response to a controller action.

Parameters

string $action
array $parameters
int $status
array $headers

Return Value

Response

Response redirectGuest(string $path, int $status = 302, array $headers = array(), bool $secure = null)

Create a new redirect response, while putting the current URL in the session.

Parameters

string $path
int $status
array $headers
bool $secure

Return Value

Response

Response redirectToIntended(string $default = '/', int $status = 302, array $headers = array(), bool $secure = null)

Create a new redirect response to the previously intended location.

Parameters

string $default
int $status
array $headers
bool $secure

Return Value

Response