Laravel Integration

Integrate VerifyWall with Laravel in minutes

Add fraud detection to your Laravel application with a single HTTP call. Works with Laravel's built-in HTTP client and middleware system.

1

Install the HTTP client

Laravel ships with Guzzle out of the box. No additional packages are needed. Store your API key in your .env file.

VERIFYWALL_API_KEY=your-api-key-here
2

Create a verification service

Create a service class that wraps the VerifyWall API. This keeps your verification logic reusable across controllers, jobs, and middleware.

<?php

namespace App\Services;

use Illuminate\Support\Facades\Http;

class VerifyWallService
{
    public function verify(?string $email = null, ?string $ip = null): array
    {
        $response = Http::withToken(config('services.verifywall.key'))
            ->post(config('services.verifywall.url') . '/v1/verify', [
                'email' => $email,
                'ip' => $ip,
            ]);

        return $response->json('data.attributes');
    }

    public function check(string $subject): array
    {
        $response = Http::withToken(config('services.verifywall.key'))
            ->get(config('services.verifywall.url') . '/v1/check', [
                'q' => $subject,
            ]);

        return $response->json('data.attributes');
    }
}
3

Add to your registration flow

Call VerifyWall during user registration to score the signup. Block or flag high-risk users before they enter your system.

use App\Services\VerifyWallService;

public function store(Request $request, VerifyWallService $verifywall)
{
    $request->validate([
        'name' => 'required|string|max:255',
        'email' => 'required|email|unique:users',
        'password' => 'required|confirmed|min:8',
    ]);

    $risk = $verifywall->verify(
        email: $request->email,
        ip: $request->ip(),
    );

    if ($risk['risk_level'] === 'high') {
        return back()->withErrors([
            'email' => 'We could not verify your identity. Please try again.',
        ]);
    }

    $user = User::create([
        'name' => $request->name,
        'email' => $request->email,
        'password' => Hash::make($request->password),
        'risk_score' => $risk['risk_score'],
    ]);

    Auth::login($user);

    return redirect('/dashboard');
}
4

Verify the integration

Test with a known disposable email to confirm VerifyWall is working. You should see a high risk score in the response.

// Run: php artisan tinker
$response = Http::withToken(config('services.verifywall.key'))
    ->post(config('services.verifywall.url') . '/v1/verify', [
        'email' => '[email protected]',
    ]);

$response->json();
// => ['risk_score' => 65, 'risk_level' => 'high', ...]

Frequently asked questions

Does VerifyWall work with Laravel Fortify or Jetstream?

Yes. VerifyWall works with any Laravel authentication system. Call the API in your CreateNewUser action (Fortify) or during registration in Jetstream. The integration is at the HTTP level, so it is framework-agnostic within Laravel.

Can I use VerifyWall in a Laravel queue job?

Yes. You can dispatch a job to check signups asynchronously if you don't want to block the registration flow. Flag the user record and process the risk check in the background.

What Laravel versions are supported?

VerifyWall is a REST API, so it works with any Laravel version. The examples use Laravel's HTTP client (Laravel 7+), but you can use Guzzle or any HTTP client in older versions. There's no SDK dependency to worry about.

Ready to integrate?

Get your API key and start protecting your Laravel application in minutes.