title: Change Password in hashed function in laravel 5.6
body: <p>I want to change my password which is been hashed while saving.</p>
  
  <p>How can i change the password?</p>
  
  <pre><code>'password' =&gt; Hash::make($data-&gt;password).
  </code></pre>
  
  <p>My Controller</p>
  
  <pre><code>$request-&gt;validate([
      'oldpass' =&gt; 'required',
      'password' =&gt; 'required|alphaNum|min:6',
      'password_confirmation' =&gt; 'required|same:newpass',
  ]);
  
  $id = $request-&gt;id;
  $users = Auth::user()-&gt;whereId($id)-&gt;get();
  
  foreach ($users as $user) {
      if ($oldpass == $user-&gt;password) {
          $user-&gt;update([
              'password' =&gt; Hash::make($request-&gt;newpass)
          ]);
          return view('\balance');
      } else {
          return 'error';
      }
  }
  </code></pre>