Enabled photos to be moved via a queue

This commit is contained in:
Deon George
2016-06-23 07:07:44 +10:00
parent e297c5ca7e
commit 4c317a811c
4 changed files with 126 additions and 11 deletions

37
app/Jobs/PhotoMove.php Normal file
View File

@@ -0,0 +1,37 @@
<?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;
class PhotoMove extends Job implements ShouldQueue
{
use InteractsWithQueue, SerializesModels;
private $photo;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct(Photo $photo)
{
$this->photo = $photo;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
Log::info('Moving: '.$this->photo->id);
}
}