Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // New route for image (s3)->display complete image without any height/width
- Route::get('/resize/{id}', function($id){
- $img = Image::make('https://s3-us-west-2.amazonaws.com/barterstore/uploads/images/'. $id)->resize(function($constraint){
- $constraint->aspectRatio();
- });
- return $img->response();
- });
- // New route for image (s3)->display image with height/width
- Route::get('/resize/{id}/{width?}/{height?}', function($id, $width=null, $height=null){
- $img = Image::make('https://s3-us-west-2.amazonaws.com/barterstore/uploads/images/'. $id)->resize($width, $height, function($constraint){
- $constraint->aspectRatio();
- });
- return $img->response();
- });
Add Comment
Please, Sign In to add comment