Performance: Form input
MEDIUM IMPACT
Form input handling affects page interaction speed and responsiveness, especially during validation and submission.
<?php
// In controller
public function store(Request $request) {
$validated = $request->validate([
'name' => 'required|string|max:255',
'email' => 'required|email',
'message' => 'required|string',
]);
dispatch(new ProcessFormDataJob($validated));
return redirect()->back()->with('status', 'Form submitted!');
}<?php
// In controller
public function store(Request $request) {
$validated = $request->validate([
'name' => 'required|string|max:255',
'email' => 'required|email',
'message' => 'required|string',
]);
// Heavy processing here
sleep(3); // Simulate slow processing
// Save data
return redirect()->back();
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Synchronous server validation with heavy processing | Minimal | 0 | Low | [X] Bad |
| Asynchronous processing with immediate response | Minimal | 0 | Low | [OK] Good |