Nov 12, 2016
0
Level 4
Queue gives [Symfony\Component\Debug\Exception\FatalThrowableError]
I am trying to run a beanstalkd queue but I get the error [Symfony\Component\Debug\Exception\FatalThrowableError] when I run queue listen
My code:
File.php
//Upload thumbnail
public function uploadThumbnail($file, $id)
{
$extension = $file->guessExtension();
$filename = 'thumnail_'.$id.'.'.$extension;
if ($file) {
$s3 = Storage::disk('local')->put($filename, $file);
}
$this->dispatch(new UploadImagesThumb($filename, $id));
}
//Queue
protected $filename;
protected $id;
public function __construct($filename, $id)
{
$this->filename = $filename;
$this->id = $id;
}
/**
* Execute the job.
*/
public function handle()
{
$qFilename = $this->$filename;
$qId = $this->id;
$image = Storage::disk('local')->get($qFilename);
$s3 = Storage::disk('s3');
$imageThumb = Image::make($image)->fit(320);
//Always set thumbnail as jpg
$imageThumb->encode('jpg');
$s3->put("images/{$qId}/thumb/thumbnail.jpg", (string) $imageThumb, 'public');
}
Please or to participate in this conversation.