-
-
Save grajib23/6128770 to your computer and use it in GitHub Desktop.
Revisions
-
sineld revised this gist
Sep 25, 2012 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,8 +30,4 @@ public function post_edit_logo($id) // move uploaded file to public/uploads Input::upload('logo', 'public/uploads', $filename); } ?> -
sineld created this gist
Sep 25, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ <?php // Resizer and Image Manipulation // Based on: http://forums.laravel.com/viewtopic.php?id=2648 public function post_edit_logo($id) { $rules = array( 'image' => 'image', ); $validation = Validator::make(Input::file('logo'), $rules); // create random filename $filename = Str::random(20) .'.'. File::extension(Input::file('logo.name')); // Save logo in the database $event = Events::where('user_id', '=', $id)->first(); $event->logo = $filename; $event->save(); // start bundle 'resizer' Bundle::start('resizer'); // resize image $img = Input::file('logo'); $success = Resizer::open($img) ->resize(60 , 30 , 'auto' ) ->save('public/uploads/thumbnails/'.$filename , 90 ); // move uploaded file to public/uploads Input::upload('logo', 'public/uploads', $filename); } So I first resized the image and then uploaded it. And the second part was that the save method accepts an file path rather than a directory path. Didn't look close enough at the documentation... Thanks everybody for your help. ?>