Loading page
Validate in Laravel, then Http::post the payload and branch on successful().
// app/Http/Controllers/ContactController.php
public function store(ContactRequest $request)
{
$response = Http::acceptJson()
->timeout(10)
->post('https://formivo.faizyab.me/api/f/YOUR_FORM_ID', $request->validated());
if (! $response->successful()) {
return back()->withErrors(['contact' => 'Could not send your message.']);
}
return back()->with('status', 'Thanks — your message was sent.');
}201 on success. Log the response body on failure, but never the full payload.
| Symptom | Fix |
|---|---|
| 419 Page Expired | Include @csrf in the form. |
| Timeout | Raise the timeout slightly and queue the call if latency matters. |