Class 'Fideloper\Proxy\TrustProxies' not found

Class 'Fideloper\Proxy\TrustProxies' not found

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
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 :