TaskQueue.php 错误 - Laravel 5 & Forge

TaskQueue.php Error - Laravel 5 & Forge

当 运行 任何帖子和 Model::create 在 Laravel 中运行时,我收到以下错误;

FatalErrorException in TaskQueue.php line 13:
Interface 'GuzzleHttp\Promise\TaskQueueInterface' not found

这在我的本地机器上工作得很好,但是一旦网站被放到带有 Forge 的服务器上,它就开始显示这个错误。

看起来服务器正在尝试将 Queue 函数与 Laravel 一起使用,但我的代码从未使用过它;

public function postCreateCustomer(){
        $input = Request::all();

        $customer = Customers::create([
            'customer_name'      => $input['customer_name'],
            'customer_url'     => $input['customer_url']
        ]);

        $password = str_random(8);
        $pass = Hash::make($password);

        $user = User::create([
            'name'      => $input['name'],
            'email'     => $input['email'],
            'password'  => $pass,
            'user_type' => 3,
            'active_customer' => $customer->id,
        ]);

        Access::create([
            'user_id'     => $user->id,
            'customer_id' => $customer->id
        ]);

        $the_content = '<p>Hello '.$input['name'].' ('.$input['customer_name'].'),</p>
        <p>Thank you for creating an account. </p>
        <p>Your login details are listed below;</p>
        <p><strong>Username</strong>: '.$input['email'].'<p>
        <p><strong>Password</strong>: '.$password.'<p>';

        $contactEmail = $input['email'];
        Mail::send('emails.default', ['the_content' => $the_content, 'the_heading' => 'Customer Account Created'], function ($message) use ($contactEmail) {
            $message->subject("Customer Account Created");
            $message->to($contactEmail);
        });

        Session::flash('success_message', 'The new customer has been created.');
        return Redirect::to('/customers');
    }

我遇到了同样的问题,我发现这是由于 class "TaskQueueInterface" 没有找到造成的。

以下是我的解决方案:

  1. 打开文件夹:/vendor/guzzlehttp/promises/src
  2. 编辑TaskQueue.php
  3. 修改"class TaskQueue implements TaskQueueInterface"为"class TaskQueue"

完成以上操作后,敬请期待正式版