3

I've just tried to upgrade from laravel 5.8 to laravel 6.

Run composer update and got the following error in the console:

 Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

 Symfony\Component\Debug\Exception\FatalThrowableError  : Call to undefined method Laravel\Cashier\Cashier::useCurrency()

 at C:\wamp\www\laravel\my-project\app\Providers\AppServiceProvider.php:34
  30|         Paginator::useBootstrapThree();
  31| 
  32|         Stripe::setApiKey(config('services.stripe.secret'));
  33| 
> 34|         Cashier::useCurrency('gbp', '£');

What does this mean?

Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64
adam78
  • 9,668
  • 24
  • 96
  • 207

2 Answers2

4

You'll want to consult the upgrade guide for Cashier.

The useCurrency method has been replaced by a configuration option in the new Cashier configuration file and the usesCurrency method has been removed.

There are a variety of significant changes in Cashier v10.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
3

removed the following from AppServiceProvider.php

Cashier::useCurrency('gbp', '£'); 

added the following to env file:

CASHIER_CURRENCY=gbp
CASHIER_CURRENCY_LOCALE=en_GB
adam78
  • 9,668
  • 24
  • 96
  • 207