ResponseFactory
class ResponseFactory implements ResponseFactory (View source)
Traits
Methods
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Return a new response from the application.
Return a new view response from the application.
Return a new JSON response from the application.
Return a new JSONP response from the application.
Create a new file download response.
Create a new redirect response to the given path.
Create a new redirect response to a named route.
Create a new redirect response to a controller action.
Create a new redirect response, while putting the current URL in the session.
Create a new redirect response to the previously intended location.
Details
static
mixed
__callStatic(
string $method,
array $parameters)
Dynamically handle calls to the class.
at line line 41
void
__construct(
Factory $view,
Redirector $redirector)
Create a new response factory instance.
at line line 55
Response
make(
string $content = '',
int $status = 200,
array $headers = array())
Return a new response from the application.
at line line 69
Response
view(
string $view,
array $data = array(),
int $status = 200,
array $headers = array())
Return a new view response from the application.
at line line 83
JsonResponse
json(
string|array $data = array(),
int $status = 200,
array $headers = array(),
int $options)
Return a new JSON response from the application.
at line line 102
JsonResponse
jsonp(
string $callback,
string|array $data = array(),
int $status = 200,
array $headers = array(),
int $options)
Return a new JSONP response from the application.
at line line 115
StreamedResponse
stream(
Closure $callback,
int $status = 200,
array $headers = array())
Return a new streamed response from the application.
at line line 129
BinaryFileResponse
download(
SplFileInfo|string $file,
string $name = null,
array $headers = array(),
string|null $disposition = 'attachment')
Create a new file download response.
at line line 147
BinaryFileResponse
file(
SplFileInfo|string $file,
array $headers = array())
Return the raw contents of a binary file.
at line line 161
RedirectResponse
redirectTo(
string $path,
int $status = 302,
array $headers = array(),
bool|null $secure = null)
Create a new redirect response to the given path.
at line line 175
RedirectResponse
redirectToRoute(
string $route,
array $parameters = array(),
int $status = 302,
array $headers = array())
Create a new redirect response to a named route.
at line line 189
RedirectResponse
redirectToAction(
string $action,
array $parameters = array(),
int $status = 302,
array $headers = array())
Create a new redirect response to a controller action.
at line line 203
RedirectResponse
redirectGuest(
string $path,
int $status = 302,
array $headers = array(),
bool|null $secure = null)
Create a new redirect response, while putting the current URL in the session.
at line line 217
RedirectResponse
redirectToIntended(
string $default = '/',
int $status = 302,
array $headers = array(),
bool|null $secure = null)
Create a new redirect response to the previously intended location.