【发布时间】: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');
}
【问题讨论】: