Skip to content

Conversation

taylormaguire
Copy link
Contributor

@taylormaguire taylormaguire commented Jun 23, 2021

Description:
Currently you are able to get the statusCode and content from a response. Content returns back the entire HTML output in some cases. When you need to render a Custom Error Page in the Exceptions\Handler for generic status codes like 403, 404, etc. it is beneficial in some cases to return the statusText protected property.

Use Case:
Rendering a custom error page for production when using Inertia.js to avoid using the error modal behaviour meant for local development and not production, as per Inertia documentation. Passing through the statusText in addition to the statusCode allows for both pre-defined error text to pass through to the custom error page/component.

This should not break any existing features and only extends out statusText in the same way that statusCode is passed down.

image

@GrahamCampbell GrahamCampbell changed the title Get statusText from Response protected property [8.x] Get statusText from Response protected property Jun 23, 2021
@taylorotwell taylorotwell merged commit d83363d into laravel:8.x Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants