Class "Fideloper\Proxy\TrustProxies" not found
Hello
I upgraded Laravel 8.83 to Laravel version 10.
I am getting below error on my page
Class "Fideloper\Proxy\TrustProxies" not found
Please guide
This error occurs because the Fideloper\Proxy\TrustProxies class is no longer available in Laravel 10.
To fix this issue, you need to update your code to use the new middleware for trusting proxies.
Here are the steps to resolve the issue:
-
Open the app/Http/Kernel.php file.
-
Locate the protected $middleware property.
-
Replace the line that includes Fideloper\Proxy\TrustProxies with the following line:
\Illuminate\Http\Middleware\TrustProxies::class,
- Save the file.
After making this change, the error should be resolved.
Getting another error
Undefined constant Illuminate\Http\Request::HEADER_X_FORWARDED_ALL
Please guide
Always follow the upgrade guides between each versions. Starting with:
Read both of the upgrade guides properly, otherwise this thread will become a direct copy of these two mentioned upgrade guides.
Please or to participate in this conversation.