laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

Flysystem\Local error back on Lumen 8

Open ghost opened this issue 4 years ago • 5 comments

Versions:

  • ide-helper Version: 2.8.x-dev
  • Lumen Version: 8.2.1
  • PHP Version: 7.4.4

Description:

Generate fails due to a dependency on League\Flysystem\Local. league/flysystem is installed but the class doesn't seem to exist.

Steps To Reproduce:

php artisan ide-helper:generate

Error shown:


In FilesystemManager.php line 164:
                                                    
  Class 'League\Flysystem\Adapter\Local' not found

ghost avatar Dec 02 '20 11:12 ghost

Looks like league/flysystem 2.0 changed its structure, so now this is in here:

  • File: vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php
  • Class path: League\Flysystem\Local\LocalFilesystemAdapter

Version 1.x is the one that fixes this error: composer require --dev league/flysystem=^1.1 but exhibits bug #1042 instead

Uplink03 avatar Dec 03 '20 16:12 Uplink03

The workaround I have now is:

  1. composer require --dev league/flysystem=^1.1

  2. Edit vendor/barryvdh/laravel-ide-helper/src/IdeHelperServiceProvider.php

    Remove or comment out this code (search for Application, lines 119-121 in mine):

            if ((int) Application::VERSION < 8) {
                return new PhpEngine();
            }
    

Of course, this doesn't help that much if you want to commit everything in git and have it work later.

Uplink03 avatar Dec 03 '20 16:12 Uplink03

@Uplink03 solution worked for me :) thanks :)

araeuchle avatar Apr 18 '21 12:04 araeuchle

I am using Lumen 8.0 version, What is solution of this problem, please share. Thanks.

kamleshwebtech avatar Apr 29 '21 07:04 kamleshwebtech

@kamleshwebtech

I am using Lumen 8.0 version, What is solution of this problem, please share. Thanks.

The following command, as @Uplink03 commented: composer require --dev league/flysystem=^1.1

Thanks again, @Uplink03!

Shikachuu avatar May 06 '21 16:05 Shikachuu

Hey 👋🏼 whilst integration in Lumen might still work, due to decline in usage of Lumen and better alternatives like Laravel Octane, Lumen is not officially supported anymore (the state of affairs where never really great, to begin with)

mfn avatar Feb 20 '23 15:02 mfn