davy_yg's avatar
Level 27

Migrate from Laravel 8 to 10

When installing fideloper/proxy I got errors. Any idea why?

D:\xampp81\htdocs\axeshop_single>composer require fideloper/proxy ./composer.json has been updated Running composer update fideloper/proxy Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.

Problem 1 - fideloper/proxy 1.0.0 requires illuminate/support 4.0.x -> found illuminate/support[v4.0.0-BETA2, ..., 4.0.x-dev] but these were not loaded, likely because it conflicts with another require. - fideloper/proxy[2.0.1, ..., 2.0.2] require illuminate/support ~4 -> found illuminate/support[v4.0.0-BETA2, ..., 4.2.x-dev] but these were not loaded, likely because it conflicts with another require. - fideloper/proxy[2.0.3, ..., 2.1.1] require illuminate/support ~4.0|~5.0 -> found illuminate/support[v4.0.0-BETA2, ..., 4.2.x-dev, v5.0.0, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require. - fideloper/proxy[dev-feature/debugger, dev-netmask, 3.0.0, ..., 3.3.4, 4.0.0, ..., 4.1.0] require illuminate/contracts ~5.0 -> found illuminate/contracts[v5.0.0, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require. - fideloper/proxy 4.2.0 requires illuminate/contracts ~5.0|~6.0 -> found illuminate/contracts[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev] but these were not loaded, likely because it conflicts with another require. - fideloper/proxy[4.2.1, ..., 4.2.2] require illuminate/contracts ^5.0|^6.0|^7.0 -> found illuminate/contracts[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but these were not loaded, likely because it conflicts with another require. - fideloper/proxy[4.3.0, ..., 4.4.0] require illuminate/contracts ^5.0|^6.0|^7.0|^8.0 -> found illuminate/contracts[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require. - fideloper/proxy[dev-master, dev-develop, 4.4.1, ..., 4.4.2] require illuminate/contracts ^5.0|^6.0|^7.0|^8.0|^9.0 -> found illuminate/contracts[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev] but these were not loaded, likely because it conflicts with another require. - Root composer.json requires fideloper/proxy * -> satisfiable by fideloper/proxy[dev-feature/debugger, dev-master, dev-netmask, dev-develop, 1.0.0, 2.0.1, ..., 2.1.1, 3.0.0, ..., 3.3.4, 4.0.0, ..., 4.4.2, 9999999-dev].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require fideloper/proxy:*" to figure out if any version is installable, or "composer require fideloper/proxy:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

0 likes
2 replies
LaryAI's avatar
Level 58

The error you're encountering is due to version conflicts between the fideloper/proxy package and the Laravel version you're using. The fideloper/proxy package is no longer needed in Laravel 9 and above, as its functionality has been integrated into the framework itself.

Here's how you can resolve this issue:

  1. Remove fideloper/proxy from your composer.json:

    Since you're migrating to Laravel 10, you don't need the fideloper/proxy package anymore. Open your composer.json file and remove the line that requires fideloper/proxy.

  2. Update your Composer dependencies:

    After removing the package from composer.json, run the following command to update your dependencies:

    composer update
    
  3. Check for Middleware:

    If you have any references to Fideloper\Proxy\TrustProxies in your middleware, you should replace it with the built-in Illuminate\Http\Middleware\TrustProxies middleware. Update your App\Http\Middleware\TrustProxies.php file to extend the correct class:

    namespace App\Http\Middleware;
    
    use Illuminate\Http\Middleware\TrustProxies as Middleware;
    
    class TrustProxies extends Middleware
    {
        // Your existing proxy configuration
    }
    
  4. Verify Configuration:

    Ensure that your config/trustedproxy.php file (if it exists) is updated according to the Laravel 10 documentation, or remove it if it's no longer needed.

By following these steps, you should be able to resolve the version conflict and successfully migrate to Laravel 10 without the need for the fideloper/proxy package.

kleninmaxim's avatar
Level 50

If you upgrade laravel from 8 to 10, you should upgrade from 8 to 9

This is upgrade guide and there is you need to remove that package instead installing:

composer remove fideloper/proxy

Also in github repository of this package we can see caution do not use this package if laravel version more than 9.x

1 like

Please or to participate in this conversation.