How to fix Laravel 403 Invalid Signature
Fermin Perdomo
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();
Newsletter
Get new posts delivered straight to your inbox.
Great Tools for Developers
Git Tower
Get Started - It's FreeA powerful Git client for Mac and Windows that simplifies version control.
Mailcoach
Start freeSelf-hosted email marketing platform for sending newsletters and automated emails.
Uptimia
Start freeWebsite monitoring and performance testing tool to ensure your site is always up and running.
Cloudways
Start freeManaged cloud hosting platform that simplifies server management for developers.
Comments
No comments yet. Be the first to share your thoughts.
chat_bubble
Join the conversation — log in to leave a comment.
Log In