Laravel integration
Block disposable emails in Laravel
You're running a Laravel app and fake signups keep getting through. Add one call to your registration flow, or drop it in as middleware, and Fidro checks every email and IP before the account exists.
How it works
Laravel's Http client is all you need. Call Fidro from a service, a form request or a middleware, then act on the answer: allow, challenge or block. Send event and user_id as well and Fidro remembers, so the fifth signup from one IP this hour gets noticed.
One fake signup can look perfectly normal. Five from the same IP in an hour don't. Send event and user_id with each call and Fidro remembers, so it catches the pattern as well as the person. You get a score from 0 to 100 and one answer: allow, challenge or block.
1. Install what you need
# Nothing to install: Laravel's HTTP client covers it
You'll also need an API key. Sign up free and you'll have one in a minute, no card needed.
2. Check every signup
Send the email and IP to POST /api/validate. Fidro checks for disposable domains, missing mail servers, VPNs, proxies and Tor, and answers allow, challenge or block. Let the allows straight in, ask the challenges to confirm their email, and turn the blocks away.
<?php
use Illuminate\Support\Facades\Http;
// In a service, action or controller
function checkSignup(string $email, string $ip): array
{
return Http::withToken(config('services.fidro.api_key'))
->timeout(5)
->post('https://fidro.io/api/validate', [
'email' => $email,
'ip' => $ip,
'event' => 'signup',
])
->throw() // Throws on 4xx and 5xx
->json();
}
// ----- Or as middleware -----
// app/Http/Middleware/FidroFraudCheck.php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
class FidroFraudCheck
{
public function handle(Request $request, Closure $next)
{
if ($request->filled('email')) {
$response = Http::withToken(config('services.fidro.api_key'))
->timeout(5)
->post('https://fidro.io/api/validate', [
'email' => $request->input('email'),
'ip' => $request->ip(),
'event' => 'signup',
]);
// Fail open: an outage on our side should never block your users
if ($response->successful()) {
if ($response->json('recommendation') === 'block') {
abort(403, 'This signup has been flagged as high risk.');
}
$request->merge(['fidro_risk_score' => $response->json('risk_score')]);
}
}
return $next($request);
}
}
3. Look up an IP
Just want to know where a request came from? GET /api/ip/{ip} returns the country, city, ISP and network, without scoring. The VPN, proxy and Tor flags come from /api/validate, under data.checks.
<?php
use Illuminate\Support\Facades\Http;
function lookupIp(string $ip): array
{
return Http::withToken(config('services.fidro.api_key'))
->timeout(5)
->get("https://fidro.io/api/ip/{$ip}")
->throw()
->json();
}
// Usage
$result = lookupIp(request()->ip());
logger()->info('Fidro IP lookup', [
'country' => $result['location']['country_name'] ?? null,
'isp' => $result['location']['isp'] ?? null,
]);
// VPN, proxy and Tor flags come from /api/validate, under data.checks
Want to see real results first? Try any address in the free IP checker.
Next steps
The API reference has every field. The free checker shows you real results. And if you're weighing up alternatives, the comparisons are honest about where others fit.
Frequently Asked Questions
How do I add fraud detection to Laravel?
Does Fidro have a Laravel SDK?
Is Fidro free to use with Laravel?
What should I do when Fidro says challenge?
Start catching bad signups in the next 5 minutes
Create your account, grab your API key, and send your first request. Free plan with 200 validations/month. No credit card. Cancel anytime.