ResponseFactory (Routing)
ResponseFactory
class ResponseFactory implements ResponseFactory (View source)
Traits
Macroable |
Methods
static void | macro( string $name, callable $macro) Register a custom macro. | from Macroable |
static bool | hasMacro( string $name) Checks if macro is registered. | from Macroable |
static mixed | __callStatic( string $method, array $parameters) Dynamically handle calls to the class. | from Macroable |
mixed | __call( string $method, array $parameters) Dynamically handle calls to the class. | from Macroable |
void | __construct( Factory $view, Redirector $redirector) Create a new response factory instance. | |
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. | |
JsonResponse | json( string|array $data = array(), int $status = 200, array $headers = array(), int $options) Return a new JSON response from the application. | |
JsonResponse | jsonp( string $callback, string|array $data = array(), int $status = 200, array $headers = array(), int $options) 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(), string|null $disposition = 'attachment') Create a new file download response. | |
RedirectResponse | redirectTo( string $path, int $status = 302, array $headers = array(), bool|null $secure = null) Create a new redirect response to the given path. | |
RedirectResponse | redirectToRoute( string $route, array $parameters = array(), int $status = 302, array $headers = array()) Create a new redirect response to a named route. | |
RedirectResponse | redirectToAction( string $action, array $parameters = array(), int $status = 302, array $headers = array()) Create a new redirect response to a controller action. | |
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. | |
RedirectResponse | redirectToIntended( string $default = '/', int $status = 302, array $headers = array(), bool|null $secure = null) Create a new redirect response to the previously intended location. |
Details
static void macro( string $name, callable $macro)
Register a custom macro.
static bool 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.
void __construct( Factory $view, Redirector $redirector)
Create a new response factory instance.
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.
JsonResponse json( string|array $data = array(), int $status = 200, array $headers = array(), int $options)
Return a new JSON response from the application.
JsonResponse jsonp( string $callback, string|array $data = array(), int $status = 200, array $headers = array(), int $options)
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(), string|null $disposition = 'attachment')
Create a new file download response.
RedirectResponse redirectTo( string $path, int $status = 302, array $headers = array(), bool|null $secure = null)
Create a new redirect response to the given path.
RedirectResponse redirectToRoute( string $route, array $parameters = array(), int $status = 302, array $headers = array())
Create a new redirect response to a named route.
RedirectResponse redirectToAction( string $action, array $parameters = array(), int $status = 302, array $headers = array())
Create a new redirect response to a controller action.
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.
RedirectResponse redirectToIntended( string $default = '/', int $status = 302, array $headers = array(), bool|null $secure = null)
Create a new redirect response to the previously intended location.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.1/Illuminate/Routing/ResponseFactory.html