akaunting / laravel-money

Currency formatting and conversion package for Laravel
https://akaunting.com
MIT License
732 stars 101 forks source link

Type Error on Composer Require #42

Closed mucan54 closed 3 years ago

mucan54 commented 3 years ago

I just try to install with composer require akaunting/money and that error appears.

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

   TypeError 

  Argument 1 passed to Akaunting\Money\Currency::setCurrencies() must be of the type array, null given, called in vendor/akaunting/money/src/Provider.php on line 22

  at vendor/akaunting/money/src/Currency.php:285
    281▕      * @param array $currencies
    282▕      *
    283▕      * @return void
    284▕      */
  ➜ 285▕     public static function setCurrencies(array $currencies)
    286▕     {
    287▕         static::$currencies = $currencies;
    288▕     }
    289▕

      +8 vendor frames 
  9   [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(Akaunting\Money\Provider))

      +5 vendor frames 
  15  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
mucan54 commented 3 years ago

Solved. Before install config cache should be clear.

1.composer remove akaunting/money 2.php artisan config:clear 3.composer require akaunting/money