2016-06-22 21:07:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Jobs;
|
|
|
|
|
|
|
|
use Log;
|
|
|
|
use App\Jobs\Job;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
use App\Model\Photo;
|
2016-06-29 04:04:02 +00:00
|
|
|
use Artisan;
|
2016-06-22 21:07:44 +00:00
|
|
|
|
|
|
|
class PhotoMove extends Job implements ShouldQueue
|
|
|
|
{
|
2016-06-29 04:04:02 +00:00
|
|
|
use InteractsWithQueue, SerializesModels;
|
2016-06-22 21:07:44 +00:00
|
|
|
|
2016-06-29 04:04:02 +00:00
|
|
|
private $photo;
|
2016-06-22 21:07:44 +00:00
|
|
|
|
2016-06-29 04:04:02 +00:00
|
|
|
/**
|
|
|
|
* Create a new job instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct(Photo $photo)
|
|
|
|
{
|
|
|
|
$this->photo = $photo;
|
|
|
|
}
|
2016-06-22 21:07:44 +00:00
|
|
|
|
2016-06-29 04:04:02 +00:00
|
|
|
/**
|
|
|
|
* Execute the job.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
2016-06-30 11:34:18 +00:00
|
|
|
Log::info(sprintf('%s: Moving [%s]',__METHOD__,$this->photo->id));
|
|
|
|
Artisan::call('photo:move',['--id' => $this->photo->id]);
|
2016-06-29 04:04:02 +00:00
|
|
|
}
|
2016-06-22 21:07:44 +00:00
|
|
|
}
|