ResponseFactory
interface ResponseFactory
Methods
Create a new response instance.
Create a new response for a given view.
Create a new JSON response instance.
Create a new JSONP response instance.
Create a new event stream response.
Create a new streamed response instance.
Create a new streamed JSON response instance.
Create a new streamed response instance as a file download.
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
at line 23
Response
make(mixed $content = '', int $status = 200, array $headers = [])
Create a new response instance.
at line 28
Response
noContent(int $status = 204, array $headers = [])
Create a new "no content" response.
at line 33
Response
view(array|string $view, array $data = [], int $status = 200, array $headers = [])
Create a new response for a given view.
at line 38
JsonResponse
json(mixed $data = [], int $status = 200, array $headers = [], int $options = 0)
Create a new JSON response instance.
at line 43
JsonResponse
jsonp(string $callback, mixed $data = [], int $status = 200, array $headers = [], int $options = 0)
Create a new JSONP response instance.
at line 48
StreamedResponse
eventStream(Closure $callback, array $headers = [], StreamedEvent|string|null $endStreamWith = '</stream>')
Create a new event stream response.
at line 53
StreamedResponse
stream(callable $callback, int $status = 200, array $headers = [])
Create a new streamed response instance.
at line 58
StreamedJsonResponse
streamJson(array $data, int $status = 200, array $headers = [], int $encodingOptions = 15)
Create a new streamed JSON response instance.
at line 63
StreamedResponse
streamDownload(callable $callback, string|null $name = null, array $headers = [], string $disposition = 'attachment')
Create a new streamed response instance as a file download.
at line 68
BinaryFileResponse
download(SplFileInfo|string $file, string|null $name = null, array $headers = [], string $disposition = 'attachment')
Create a new file download response.
at line 73
BinaryFileResponse
file(SplFileInfo|string $file, array $headers = [])
Return the raw contents of a binary file.
at line 78
RedirectResponse
redirectTo(string $path, int $status = 302, array $headers = [], bool|null $secure = null)
Create a new redirect response to the given path.
at line 83
RedirectResponse
redirectToRoute(BackedEnum|string $route, mixed $parameters = [], int $status = 302, array $headers = [])
Create a new redirect response to a named route.
at line 88
RedirectResponse
redirectToAction(array|string $action, mixed $parameters = [], int $status = 302, array $headers = [])
Create a new redirect response to a controller action.
at line 93
RedirectResponse
redirectGuest(string $path, int $status = 302, array $headers = [], bool|null $secure = null)
Create a new redirect response, while putting the current URL in the session.
at line 98
RedirectResponse
redirectToIntended(string $default = '/', int $status = 302, array $headers = [], bool|null $secure = null)
Create a new redirect response to the previously intended location.