Class 'Fideloper\Proxy\TrustProxies' not found
Asked
Active
Viewed 4.2k times
13

Jithin Raj P R
- 6,667
- 8
- 38
- 69

Lupitha Yañez C.
- 354
- 1
- 2
- 7
-
3Did you install it? `composer require fideloper/proxy` – ceejayoz Nov 09 '17 at 03:27
-
1@LupithaYañezC. OK. As a general rule, you're going to have to install stuff before you can use it. :-/ – ceejayoz Nov 09 '17 at 13:34
-
3@ceejayoz TrustProxies is included by default on Laravel 5.5+ installations: https://laravel-news.com/trusted-proxy – Chuck Le Butt Nov 27 '17 at 17:23
-
i installed laravel 5.7 a few minutes ago and for some reason i have the same issue... – Stormsson Nov 07 '18 at 21:17
-
3You might need to follow [this](https://stackoverflow.com/a/71117387/3347337) answer if you are upgrading to Laravel 9. – Gucu112 Feb 21 '22 at 20:06
3 Answers
5
If you faced the error after upgrading laravel 8 to 9 or 10 we don't need the Trustproxies package from the composer. You can simply remove by composer remove fideloper/proxy and update your packages by composer update command. it's properly mentioned in the laravel 9 upgrade guide. laravel.com/docs/9.x/upgrade#the-assert-deleted-method

Sujata Jadhav
- 51
- 1
- 2
1
in Laravel v10, as @Sujata Jadhav wrote,
I remove fideloper/proxy
and in app/Http/Middleware/TrustProxies.php
,
I changed :
use Fideloper\Proxy\TrustProxies as Middleware;
// […]
protected $headers = Request::HEADER_X_FORWARDED_ALL;
with
use Illuminate\Http\Middleware\TrustProxies as Middleware;
// […]
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO; // I removed AWS_ELB line as I don't need it
as we can see at doc pages :

bcag2
- 1,988
- 1
- 17
- 31