I'm using this package http://image.intervention.io/getting_started/installation to compress my images that's uploaded to my server. However the images are not being compressed.
First I installed the Intervention package by putting this in my terminal:
composer require intervention/image
Then I added this at the top of my controller:
use Intervention\Image\ImageManagerStatic as Image;
Then I added the encode to minify the image
Image::make(request()->file('img'))->encode('jpg', 1);
It's not minifying the image. It's still the same size.
<?php namespace App\Http\Controllers; use Intervention\Image\ImageManagerStatic as Image; use Illuminate\Support\Facades\Storage; use Illuminate\Http\Request; class UploadsController extends Controller { public function store() { // Get image $img = request()->file('img'); // Minify image Image::make($img)->encode('jpg', 1); // Store image in uploads folder Storage::disk('public')->put('uploads', $img); } }