【问题标题】:Laravel cashier errorLaravel 收银员错误
【发布时间】:2014-10-26 20:58:47
【问题描述】:

我正在尝试将 laravel 收银员用于我正在构建的网站,但出现此错误:

Laravel\Cashier\BillableTrait::invoices($parameters = Array)的声明必须与Laravel\Cashier\BillableInterface::invoices()兼容

我已按照 laravel 网站上的安装说明进行操作。

我的用户模型:

<?php

use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
use Laravel\Cashier\BillableTrait;
use Laravel\Cashier\BillableInterface;

class User extends Eloquent implements UserInterface, RemindableInterface, BillableInterface 
{
    use UserTrait, RemindableTrait, BillableTrait;

    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'users';

    /**
     * @var array
     */

    protected $dates = ['trial_ends_at', 'subscription_ends_at'];

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    protected $hidden = array('password', 'remember_token');

}

任何帮助将不胜感激。

提前致谢。

【问题讨论】:

  • 你是如何最终解决这个问题的?我也遇到了。

标签: php laravel


【解决方案1】:

我也遇到了这个错误。 (到目前为止)这似乎只是 laravel/cashier 2.0.4 版的一个问题。我恢复到 2.0.3 版。

【讨论】:

    【解决方案2】:

    听起来您可能对版本/缓存有一些作曲家问题。您是否做过composer dumpautoload 或更好的composer update,然后是php artisan cache:clear

    您的composer.json 在收银员条目中是什么样的?

    【讨论】:

      猜你喜欢
      • 2019-01-08
      • 2014-10-28
      • 2018-03-28
      • 2018-06-17
      • 2022-11-18
      • 2015-04-28
      • 2017-09-27
      • 2021-02-26
      • 2021-02-18
      相关资源
      最近更新 更多