Laravel 5.6 Trusted Proxies Error

Recently I upgraded a project of mine upto Laravel 5.6 and came accross this error

Type error: Argument 2 passed to Symfony\Component\HttpFoundation\Request::setTrustedProxies() must be of the type integer, array given, called in /var/www/html/vendor/fideloper/proxy/src/TrustProxies.php on line 54

To fix this you will need to goto your TrustedProxies.php middleware and change the code from ::

/**
* The current proxy header mappings.
*
* @var array
*/
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',
];

To ::

use Illuminate\Http\Request;

/**
 * The headers that should be used to detect proxies.
 *
 * @var string
 */
protected $headers = Request::HEADER_X_FORWARDED_ALL;

As stated in https://laravel.com/docs/5.6/upgrade "Trusted Proxies"