laravel-ide-helper
laravel-ide-helper copied to clipboard
Flysystem\Local error back on Lumen 8
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
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
The workaround I have now is:
-
composer require --dev league/flysystem=^1.1
-
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 solution worked for me :) thanks :)
I am using Lumen 8.0 version, What is solution of this problem, please share. Thanks.
@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!
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)