Laravel
Blade forms with Laravel validation.
Keys required. Create a site in the dashboard and copy your site key (HTML) and secret key (server). Replace
sq_live_your_key in the snippets below.
How this integration works
Same three steps as every other platform — only the paste location and server hook change.
| Step | What you do for Laravel |
|---|---|
| 1 | Load squeaker.js once on pages with the form. |
| 2 | Blade template: widget inside <form>, squeaker.js in layout before </body>. |
| 3 | Verify squeaker-token on your server before saving or forwarding the submission. |
Where to put the widget
Blade template: widget inside <form>, squeaker.js in layout before </body>.
Recommended settings
| Setting | Value |
|---|---|
| Widget mode | Auto (recommended) — Runs on form submit — best for most forms |
| Form ID | #contact-form |
| Server verify | PHP, Node.js |
Important notes
- Verify in your controller before $request->validate() or after reading squeaker-token.
Copy-paste snippet
Paste into your Laravel form or template. Load squeaker.js once per page.
<!-- Blade template: widget inside <form>, squeaker.js in layout before </body>. --> <squeaker-widget data-sitekey="sq_live_your_key" data-api="https://api.squeaker.cc/v1" data-mode="auto" data-theme="light" data-form="#contact-form" ></squeaker-widget> <!-- Load squeaker.js once per page --> <script src="https://cdn.squeaker.cc/squeaker.js" async defer></script> <!-- Verify squeaker-token on your server before processing the form -->
Server verification
Read squeaker-token from the request and POST to /v1/verify with your secret key.
Full reference: Server verify docs.
$token = $_POST['squeaker-token'] ?? '';
if ($token === '') {
http_response_code(400);
exit('Missing token');
}
$apiUrl = getenv('SQUEAKER_API_URL') ?: 'https://api.squeaker.cc/v1';
$payload = json_encode([
'secret' => getenv('SQUEAKER_SECRET'),
'token' => $token,
'remoteip' => $_SERVER['REMOTE_ADDR'] ?? null,
]);
$ctx = stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/json\r\n",
'content' => $payload,
],
]);
$response = file_get_contents("{$apiUrl}/verify", false, $ctx);
$result = json_decode($response, true);
if (!$result['success']) {
http_response_code(403);
exit($result['error'] ?? 'Invalid token');
}
// Token valid — process the form Open setup generator with Laravel pre-selected · Browse all platforms