2

我已经添加了:

"laravel/cashier": "^6.0"

到 composer.json

和:

Laravel\Cashier\CashierServiceProvider::class,

到 config 文件夹中 providers 数组中的 app.php 。

然后我运行了作曲家更新,但如果我这样做:

php artisan

我没有看到那里的收银员命令。我错过了一步吗?

4

1 回答 1

4

该命令似乎在 5.2 中被删除。在查看5.2 的文档时,它们已经更新,不再提及使用 artisan helper `$php artisan cashier:table users

相反,您现在似乎必须手动创建迁移,而不是使用帮助程序。从文档:

更新用户表迁移(或与计费相关联的任何实体):

Schema::table('users', function ($table) {
    $table->string('stripe_id')->nullable();
    $table->string('card_brand')->nullable();
    $table->string('card_last_four')->nullable();
});

创建订阅表:

Schema::create('subscriptions', function ($table) {
    $table->increments('id');
    $table->integer('user_id');
    $table->string('name');
    $table->string('stripe_id');
    $table->string('stripe_plan');
    $table->integer('quantity');
    $table->timestamp('trial_ends_at')->nullable();
    $table->timestamp('ends_at')->nullable();
    $table->timestamps();
});

然后运行迁移命令$ php artisan migrate

我无法找到有关此更改原因的任何信息,或者他们将来是否会重新引入此工匠命令。我认为这是设计使然。

单击此处了解有关创建迁移的更多信息。

希望能帮助到你!

于 2016-01-28T23:59:40.607 回答