mailerlite / laravel-elasticsearch

An easy way to use the official Elastic Search client in your Laravel applications.
MIT License
909 stars 187 forks source link

Can't Install on Laravel "^8.12", error when generating optimized autoload files #122

Closed taghwo closed 3 years ago

taghwo commented 3 years ago

Would like to thank you for this package. The issue I have is, after installing, everything breaks with the error below. I can't even clear config cache anymore. What is the disk it's asking for?

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   InvalidArgumentException

  Disk [] does not have a configured driver.

  at E:\laragon\www\api-v2\src\vendor\laravel\framework\src\Illuminate\Filesystem\FilesystemManager.php:117
    113▕     {
    114▕         $config = $this->getConfig($name);
    115▕
    116▕         if (empty($config['driver'])) {
  ➜ 117▕             throw new InvalidArgumentException("Disk [{$name}] does not have a configured driver.");
    118▕         }
    119▕
    120▕         $name = $config['driver'];
    121▕

  1   E:\laragon\www\api-v2\src\vendor\laravel\framework\src\Illuminate\Filesystem\FilesystemManager.php:101
      Illuminate\Filesystem\FilesystemManager::resolve()

  2   E:\laragon\www\api-v2\src\vendor\laravel\framework\src\Illuminate\Filesystem\FilesystemManager.php:78
      Illuminate\Filesystem\FilesystemManager::get()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

steps taken to reproduce issue

dependencies and version

I would really appreciate any help I can get to make this work.

cviebrock commented 3 years ago

I don't think there is a 8.12 version of Laravel. The latest is 8.5.15. Maybe you meant 8.5.12?

In any case, I created a fresh install of Laravel 8.5.15 and ran composer require cviebrock/laravel-elasticsearch and it all installed just fine. So I'm not sure what to suggest. Maybe post your composer.json file ... perhaps something else is causing issues?

taghwo commented 3 years ago

Thanks for the reply. Will dig into it this weekend and give an update on this.

taghwo commented 3 years ago

The error was from a service provider that was overriding my Filesystem drivers, it was nothing related to the package. Package is working fine. Will close issue now. Thanks

EquineOntology commented 2 years ago

As an FYI for anybody who might come later, I just came across this same issue after upgrading a very old laravel project (5.1) all the way to 8. It worked completely fine, and only failed on doing composer require cviebrock/laravel-elasticsearch. The original author of the project had removed the filesystems.php config as it was not needed.

As it happens, when I added the file again I saved it as filesystem.php (singular instead of plural), which will of course provide the right config, but under the wrong key :) Double check you don't have typos in your file names!