Response
class Response (View source)
Traits
Properties
static protected array | $macros | The registered string macros. |
from MacroableTrait |
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.
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.
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.