Performance: Custom error messages
MEDIUM IMPACT
This affects the server response time and the size of the response payload sent to the browser.
return redirect()->back()->withErrors(['email' => 'Please enter your email address to continue.']);
return redirect()->back()->withErrors(['email' => 'The email field is required.']);
| Pattern | Server Processing | Response Size | User Experience | Verdict |
|---|---|---|---|---|
| Default error messages | Low | Small | Confusing, may cause retries | [!] OK |
| Custom concise messages | Slightly higher | Small to medium | Clear, reduces retries | [OK] Good |
| Verbose or numerous messages | Higher | Large | May slow load, overwhelm user | [X] Bad |