Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Larvel队列';关闭';不允许_Php_Laravel_Laravel 5_Queue - Fatal编程技术网

Php Larvel队列';关闭';不允许

Php Larvel队列';关闭';不允许,php,laravel,laravel-5,queue,Php,Laravel,Laravel 5,Queue,我已经试过解决问题,但最终,他们没有解决我的问题 我将作业添加到队列中,如下所示 还有我的工作 class RestoreApplicationJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; protected $datas; public $tries = 1; public function __construct($datas) {

我已经试过解决问题,但最终,他们没有解决我的问题

我将作业添加到队列中,如下所示

还有我的工作

class RestoreApplicationJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

protected $datas;

public $tries = 1;


public function __construct($datas)
{
    $this->datas = $datas;
}

public function handle()
{
    try{
        $application = $this->datas['application'];
        $notification = $this->datas['notification'];
        $application->activate();
        $tmp_data = $notification->data;
        $tmp_data['state'] = Opertation::SUCCESS;

        $notification->data = $tmp_data;
        $notification->save();
    }catch(\Exception $e)
    {
        Log::error($e->getMessage());
        Log::error($e->getTraceAsString());

        $tmp_data = $notification->data;
        $tmp_data['state'] = Opertation::FAILED;

        $notification->data = $tmp_data;
        $notification->save();
    }
}
}

我有一个错误:

不允许对“Closure”进行序列化

我检查了很多次,但什么也没找到


谢谢你的帮助,很抱歉我的英语这么差:)

我的问题太疯狂了

这只是我调用类
Operation
instand的
Operation
内部作业。 那个抛出异常

class RestoreApplicationJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

protected $datas;

public $tries = 1;


public function __construct($datas)
{
    $this->datas = $datas;
}

public function handle()
{
    try{
        $application = $this->datas['application'];
        $notification = $this->datas['notification'];
        $application->activate();
        $tmp_data = $notification->data;
        $tmp_data['state'] = Opertation::SUCCESS;

        $notification->data = $tmp_data;
        $notification->save();
    }catch(\Exception $e)
    {
        Log::error($e->getMessage());
        Log::error($e->getTraceAsString());

        $tmp_data = $notification->data;
        $tmp_data['state'] = Opertation::FAILED;

        $notification->data = $tmp_data;
        $notification->save();
    }
}