Skip to content

Instantly share code, notes, and snippets.

@RudyJessop
Last active October 28, 2015 13:39
Show Gist options
  • Save RudyJessop/284921fecdbb7c7884bf to your computer and use it in GitHub Desktop.
Save RudyJessop/284921fecdbb7c7884bf to your computer and use it in GitHub Desktop.
Saving Images as thumbnails for MVC Projects
<?php
// For thumbnails
$file = $request->file('file');
//Create thubmnail
$thmname = time().$file->getClientOriginalName(); // Thumbnail naming
$thmfilepath = $filesystem->disk('s3')->put('/tn_/'.$thmname, '');
$image = Image::make($file)->fit(115)->save($thmname); // For Thumbnail image save
$file->move($holder, $Imagename); // For original Image save
$user->usersPhotos()->create([
'image_thumbnail' => $thmfilepath,
'image_name' => $Imagename,
]);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment