ResponseTrait
trait ResponseTrait
Properties
| mixed | $original | The original content of the response. |
|
| Throwable|null | $exception | The exception that triggered the error response (if applicable). |
Methods
Get the status code for the response.
Get the status text for the response.
Get the content of the response.
Get the original response content.
Set a header on the Response.
Add an array of headers to the response.
Remove a header(s) from the response.
Add a cookie to the response.
Add a cookie to the response.
Expire a cookie when sending the response.
Get the callback of the response.
Throw the response in a HttpResponseException instance.
Details
at line 26
int
status()
Get the status code for the response.
at line 34
string
statusText()
Get the status text for the response.
at line 42
string
content()
Get the content of the response.
at line 50
mixed
getOriginalContent()
Get the original response content.
at line 62
ResponseTrait
header(string $key, array|string $values, bool $replace = true)
Set a header on the Response.
at line 74
ResponseTrait
withHeaders(HeaderBag|array $headers)
Add an array of headers to the response.
at line 92
ResponseTrait
withoutHeader(array|string $key)
Remove a header(s) from the response.
at line 106
ResponseTrait
cookie(mixed $cookie)
Add a cookie to the response.
at line 116
ResponseTrait
withCookie(mixed $cookie)
Add a cookie to the response.
at line 132
ResponseTrait
withoutCookie(mixed $cookie, string|null $path = null, string|null $domain = null)
Expire a cookie when sending the response.
at line 146
string|null
getCallback()
Get the callback of the response.
at line 156
ResponseTrait
withException(Throwable $e)
Set the exception to attach to the response.
at line 168
never
throwResponse()
Throw the response in a HttpResponseException instance.