Ejemplo n.º 1
0
 public function post_adminimageupload($id)
 {
     $validate = UserDetails::validate_image(Input::all());
     if ($validate->passes()) {
         $user = UserDetails::where('employee_id', $id)->first();
         $image = Input::file('images');
         $filename = time() . '.' . $image->getClientOriginalName();
         $path = public_path('images/' . $filename);
         Image::make($image->getRealPath())->fit(150, 150)->save($path);
         $user->profile_mage = 'images/' . $filename;
         $user->save();
         return Redirect::route('administrator');
     } else {
         return Redirect::route('administrator')->withErrors($validate);
     }
 }