1

I have just cloned Laravel 8 /Vue js project and I am trying to run it, I have got this error

Argument 2 passed to Symfony\Component\HttpFoundation\Request::setTrustedProxies() must be of the type int, array given, called in C:\lab\vue-laravel-crud-2\vue-laravel-crud\vendor\fideloper\proxy\src\TrustProxies.php on line 54

I have googled this error and I have added this to my code but It was not working This is how was the code

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;

I have replaced it with this code

protected $headers = [
        Request::HEADER_FORWARDED => 'FORWARDED',
        Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
        Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
        Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
        Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
    ];

But the error is remaining , do anyone has an idea about this error as I have googled it a lot and nothing was found . Thanks in advance .

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.