photo/app/Jobs/VideoMove.php

40 lines
709 B
PHP
Raw Normal View History

2016-07-04 06:00:33 +00:00
<?php
namespace App\Jobs;
2019-11-09 02:52:04 +00:00
use Illuminate\Support\Facades\Log;
2016-07-04 06:00:33 +00:00
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
2019-11-09 02:52:04 +00:00
use Illuminate\Support\Facades\Artisan;
use App\Models\Video;
2016-07-04 06:00:33 +00:00
class VideoMove extends Job implements ShouldQueue
{
2019-11-09 02:52:04 +00:00
use InteractsWithQueue,SerializesModels;
2016-07-04 06:00:33 +00:00
2020-01-04 22:37:50 +00:00
public $video;
2016-07-04 06:00:33 +00:00
/**
* Create a new job instance.
*
* @return void
*/
2020-01-04 22:37:50 +00:00
public function __construct(Video $o)
2016-07-04 06:00:33 +00:00
{
2020-01-04 22:37:50 +00:00
$this->video = $o;
2016-07-04 06:00:33 +00:00
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
Log::info(sprintf('%s: Moving [%s]',__METHOD__,$this->video->id));
Artisan::call('video:move',['--id' => $this->video->id]);
}
}