145 - Resizing the Poster Image

This commit is contained in:
Adam Wathan
2017-11-14 17:02:10 -05:00
parent 6e1924e5c9
commit 9a70efd473
5 changed files with 112 additions and 3 deletions

View File

@@ -3,7 +3,9 @@
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Intervention\Image\Facades\Image;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Storage;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
@@ -21,6 +23,9 @@ class ProcessPosterImage implements ShouldQueue
public function handle()
{
//
$imageContents = Storage::disk('public')->get($this->concert->poster_image_path);
$image = Image::make($imageContents);
$image->resize(600)->encode();
Storage::disk('public')->put($this->concert->poster_image_path, (string) $image);
}
}