Fidro + Laravel Integration
Block disposable emails in Laravel with one API call. Follow this guide to add email validation and IP intelligence in minutes.
Overview
To integrate Fidro with Laravel, use Laravel's built-in HTTP client to send a POST request to the Fidro API with the user's email and IP address. Fidro returns email validation, disposable domain detection, IP intelligence, and a fraud risk score in a single API call. No additional packages are needed beyond Laravel itself — the framework's HTTP facade handles everything, and you can even add Fidro as middleware for automatic fraud checks.
Fidro is a fraud detection API that combines email validation, IP intelligence, geolocation analysis, and Stripe chargeback prevention in a single API call. It returns a risk score with a clear recommendation — allow, review, or block — so you can stop fraud without building your own scoring logic.
1. Install Dependencies
# Uses Laravel's built-in HTTP client — no extra packages needed
You will also need a Fidro API key. Sign up for free to get one.
2. Email Validation
Send a POST request to Fidro's /v1/validate endpoint with the user's email address and optional IP. Fidro validates the email, checks for disposable domains, analyzes the IP for VPN/proxy/Tor usage, and returns a risk score with a clear recommendation — allow, review, or block.
<?php
use Illuminate\Support\Facades\Http;
// Simple validation in a controller or service
function validateEmail(string $email, string $ip): array
{
$response = Http::withToken(config('services.fidro.api_key'))
->post('https://api.fidro.io/v1/validate', [
'email' => $email,
'ip' => $ip,
]);
$response->throw(); // Throws on 4xx/5xx errors
$result = $response->json();
logger()->info('Fidro validation', [
'email' => $email,
'risk_score' => $result['data']['risk_score'],
'recommendation' => $result['data']['recommendation'],
]);
return $result;
}
// ----- Middleware example -----
// 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->has('email')) {
$response = Http::withToken(config('services.fidro.api_key'))
->post('https://api.fidro.io/v1/validate', [
'email' => $request->input('email'),
'ip' => $request->ip(),
]);
if ($response->successful()) {
$data = $response->json('data');
if ($data['recommendation'] === 'refund') {
abort(403, 'This request has been flagged as fraudulent.');
}
$request->merge(['fidro_risk_score' => $data['risk_score']]);
}
}
return $next($request);
}
}
3. IP Lookup
Send a POST request to Fidro's /v1/ip-lookup endpoint with an IP address. Fidro returns geolocation data (country, city, ISP), VPN and proxy detection, Tor exit node identification, and threat intelligence — all in a single API call.
<?php
use Illuminate\Support\Facades\Http;
function lookupIP(string $ip): array
{
$response = Http::withToken(config('services.fidro.api_key'))
->post('https://api.fidro.io/v1/ip-lookup', [
'ip' => $ip,
]);
$response->throw();
$result = $response->json();
logger()->info('Fidro IP lookup', [
'ip' => $ip,
'country' => $result['data']['country'],
'is_vpn' => $result['data']['is_vpn'],
]);
return $result;
}
// Usage in a controller
public function store(Request $request)
{
$ipData = lookupIP($request->ip());
if ($ipData['data']['is_vpn']) {
// Flag for review or block
logger()->warning('VPN detected', ['ip' => $request->ip()]);
}
// Continue with your logic...
}
Test the IP lookup response format with our free IP checker tool before integrating.
Next steps
Explore the full API reference, try the free email checker, or see how Fidro compares to other solutions.
Frequently Asked Questions
How do I add fraud detection to Laravel?
Does Fidro have a Laravel SDK?
Is Fidro free to use with Laravel?
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.
Get Started Free