original_string: public function profileData()
      {
          $user = Auth::user();
  
          $profile = UserProfile::whereUserId($user->id)->first();
  
          $data = Input::all();
  
          $rules = [
              'nombre' => 'required',
              'apellidos' => 'required'
          ];
  
          $validator = Validator::make($data, $rules);
  
          if($validator->passes())
          {
              $profile->fill($data);
              $profile->save();
  
              //REDIRECCIONAR A PAGINA PARA VER DATOS
              return redirect()->route('admin.user.profile');
          }
          else
          {
              return Redirect::back()->withInput()->withErrors($validator->messages());
          }
      }
code: public function profileData()
      {
          $user = Auth::user();
  
          $profile = UserProfile::whereUserId($user->id)->first();
  
          $data = Input::all();
  
          $rules = [
              'nombre' => 'required',
              'apellidos' => 'required'
          ];
  
          $validator = Validator::make($data, $rules);
  
          if($validator->passes())
          {
              $profile->fill($data);
              $profile->save();
  
              //REDIRECCIONAR A PAGINA PARA VER DATOS
              return redirect()->route('admin.user.profile');
          }
          else
          {
              return Redirect::back()->withInput()->withErrors($validator->messages());
          }
      }
code_tokens: public function profileData ( ) { $ user = Auth :: user ( ) ; $ profile = UserProfile :: whereUserId ( $ user -> id ) -> first ( ) ; $ data = Input :: all ( ) ; $ rules = [ 'nombre' => 'required' , 'apellidos' => 'required' ] ; $ validator = Validator :: make ( $ data , $ rules ) ; if ( $ validator -> passes ( ) ) { $ profile -> fill ( $ data ) ; $ profile -> save ( ) ; //REDIRECCIONAR A PAGINA PARA VER DATOS return redirect ( ) -> route ( 'admin.user.profile' ) ; } else { return Redirect :: back ( ) -> withInput ( ) -> withErrors ( $ validator -> messages ( ) ) ; } }
docstring: Funcion para cambiar datos de Perfil de usuario logeado
docstring_tokens: Funcion para cambiar datos de Perfil de usuario logeado