Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/vendor/voku/.././phar-io/./../../app/Jobs
الملفات الموجودة في هذا الـ Path:
.
..
AfterGenerate.php
CampaignCreateChunk.php
CampaignCreateJob.php
CampaignCreateSuccessJob.php
ChunkImport.php
ChunkImportFail.php
ListBuilderQueue.php

مشاهدة ملف: CampaignCreateSuccessJob.php

<?php

namespace App\Jobs;

use App\Models\Campaign;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

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

    private $campaign;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($campaign)
    {
        $this->campaign=$campaign;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $this->campaign->update(['status'=>'running']);
    }

    public function failed(\Exception $exception)
    {
        $this->campaign->update(['status'=>'failed','import_fail_message'=>substr($exception->getMessage(), 0, 191)]);
    }
}