In my case, I used "fideloper/proxy": "^4.0" in Laravel 8.
In Laravel 9+, it is not necessary as it is built in, you are save to remove the line of "fideloper/proxy" in composer.json.
Just make sure you go to app/Http/Middleware/TrustProxies.php and modify the $headers:
protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB;