1 回答

TA貢獻1815條經(jīng)驗 獲得超6個贊
我相信這是 PHP 7.3 和 Laravel 5.8 之間的兼容性問題。引發(fā)錯誤是因為 Queueable trait 已經(jīng)定義了 'connection' 類變量。
要修復(fù)錯誤,我們只需要設(shè)置變量而不是聲明它。
破碎作業(yè)類:
class UpdateProductInventory implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $connection = 'database';
}
固定作業(yè)類:
class UpdateProductInventory implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $product;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
$this->connection = 'database';
}
}
- 1 回答
- 0 關(guān)注
- 392 瀏覽
添加回答
舉報