Fermin Perdomo

Senior Full Stack Engineer | PHP | JavaScript

How to fix Laravel 403 Invalid Signature

Fermin Perdomo
May 7, 2025

If you are using a mail service provider like SendGrid, it can create a proxy that may cause issues when you try to validate emails, for example.

To fix this, go to your bootstrap app file and add this line to the middleware:

$middleware->trustProxies(at: '*');

Then it should look like this:

// bootstrap/app.php 
<?php 

use Illuminate\Foundation\Application; 
use Illuminate\Foundation\Configuration\Exceptions; 
use Illuminate\Foundation\Configuration\Middleware; 

return Application::configure(basePath: dirname(__DIR__)) 
    ->withRouting( 
        web: __DIR__.'/../routes/web.php',
        commands: __DIR__.'/../routes/console.php', health: '/up', 
    ) 
    ->withMiddleware(function (Middleware $middleware) { 
        $middleware->trustProxies(at: '*'); 
    }) 
    ->withExceptions(function (Exceptions $exceptions) { // 
    })
    ->create();

Reactions

Loading reactions...
Log in to react to this post.

Comments

Please login to leave a comment.

Great Tools for Developers

Git tower

Git tower

A powerful Git client for Mac and Windows that simplifies version control.

Get Started - It's Free
Visit Tool
Mailcoach's

Mailcoach's

Self-hosted email marketing platform for sending newsletters and automated emails.

Start free
Visit Tool
Uptimia

Uptimia

Website monitoring and performance testing tool to ensure your site is always up and running.

Start free
Visit Tool

Newsletter