【问题标题】:TaskQueue.php Error - Laravel 5 & ForgeTaskQueue.php 错误 - Laravel 5 & Forge
【发布时间】:2017-04-23 22:34:09
【问题描述】:

在 Laravel 中运行任何 Posts 和 Model::create 函数时,我会遇到以下错误;

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

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

看起来服务器正在尝试在 Laravel 中使用 Queue 功能,但我的代码从未使用过它;

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');
    }

【问题讨论】:

    标签: laravel laravel-5 forge


    【解决方案1】:

    我遇到了同样的问题,我发现这是由于没有找到“TaskQueueInterface”类引起的。

    以下是我的解决方案:

    1. 打开文件夹:/vendor/guzzlehttp/promises/src
    2. 编辑TaskQueue.php
    3. 修改“类TaskQueue实现TaskQueueInterface”为“类TaskQueue”

    做完以上,敬请期待正式发布。

    【讨论】:

    • 这可能是作者粗心的错误,因为我找不到那个类。
    猜你喜欢
    • 2016-04-29
    • 2016-01-29
    • 2016-08-18
    • 2019-07-14
    • 2015-04-14
    • 2016-02-11
    • 2023-03-20
    • 2019-01-08
    • 2014-10-25
    相关资源
    最近更新 更多