【问题标题】:Laravel 5.2 and CashierLaravel 5.2 和 Cashier
【发布时间】:2016-04-15 12:43:44
【问题描述】:

我已添加:

"laravel/cashier": "^6.0"

到 composer.json

和:

Laravel\Cashier\CashierServiceProvider::class,

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

然后我运行了 composer update,但如果我这样做了:

php artisan

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

【问题讨论】:

  • 确实是这样,我自己也上过这个,没看到工匠命令

标签: laravel laravel-5.2 laravel-artisan laravel-cashier


【解决方案1】:

该命令似乎在 5.2 中被删除。在查看docs for 5.2 时,它们已更新,不再提及使用工匠助手`$php artisan cashier:table users

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

更新 user 表迁移(或与帐单关联的任何实体):

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

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

Click here for more info on creating migrations.

希望对你有帮助!

【讨论】:

    猜你喜欢
    • 2016-07-31
    • 2016-10-02
    • 2016-08-04
    • 2020-05-09
    • 2022-06-15
    • 2016-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多