Image Uploads
Handle uploaded images
2.8M Downloads / Month
Open Source MIT License
2.8M Downloads / Month
Open Source MIT License
PHP lets people upload files and with Intervention Image you can easily pass an uploaded image to the make() method. The standard way is to get the temp. file information from the $_FILES
array.
Read more about file uploads in the official PHP documentation.
// read image from temporary file
$img = Image::make($_FILES['image']['tmp_name']);
// resize image
$img->fit(300, 200);
// save image
$img->save('foo/bar.jpg');
In a Laravel application it is also possible to pass an uploaded file directly to the make method.
// resizing an uploaded file
Image::make(Request::file('photo'))->resize(300, 200)->save('foo.jpg');
Edit