1
votes

When I run composer update, I get the following error:

Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating autoload files Illuminate\Foundation\ComposerScripts::postUpdate php artisan optimize [Symfony\Component\Debug\Exception\FatalErrorException] Class 'Laravel\Cashier\CashierServiceProvider' not found Script php artisan optimize handling the post-update-cmd event returned with err or code 255

I put this code on the app.php file

Laravel\Cashier\CashierServiceProvider::class,

and in the composer.json I also put this

"laravel/cashier": "~6.0"

like in the laravel doc

stack errot

2

2 Answers

6
votes

Remove the

Laravel\Cashier\CashierServiceProvider::class,

from app.php. It needs to be added after installing the package.

Also, instead of composer update, try composer require without changing the composer.json file.

composer require laravel/cashier
0
votes

Don't add anything in composer.json file or app.php.

Just follow the documentation given in Laravel website for Laravel Cashier, (select the laravel version which you are using in your project).

Run the commands in following order:

//install the package and add it in composer file
 composer require laravel/cashier

//add your cashier class in 'providers' array in app.php
 Laravel\Cashier\CashierServiceProvider::class,

//add alias in 'aliases' array in app.php
'Cashier' => Laravel\Cashier\CashierServiceProvider::class,

//will add several columns to users table & create a new subscriptions table
 php artisan migrate