title: Call to a member function update() on null in laravel
body: <p>So i want to make admin can change any user's password. but i got this error</p>
  <blockquote>
  <p>Call to a member function update() on null</p>
  </blockquote>
  <p>I have no idea what to do</p>
  <p>this is my controller</p>
  <pre><code>public function resetPassword(Request $req, $id)
  {
      $req-&gt;validate([
          'new_password' =&gt; ['required'],
          'new_confirm_password' =&gt; ['same:new_password'],
      ],
      [
          'new_password.required' =&gt; 'Password Baru Harus Diisi !',
          'new_confirm_password.same' =&gt; 'Password Baru Harus Sama Dengan Confirm Password !',
      ]);
      User::find($id)-&gt;update(['password'=&gt; Hash::make($req-&gt;new_password)]);
      return redirect('/admin/list_user')-&gt;with('status', 'Password Berhasil di Ubah !');
  }
  </code></pre>
  <p>this my route</p>
  <pre><code>Route::put('/admin/{id}/reset/password', 'PageController@resetPassword')-&gt;name('resetPassword');
  </code></pre>
  <p>this is my view modal</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;div class=&quot;modal fade&quot; id=&quot;resetModal&quot; tabindex=&quot;-1&quot; role=&quot;dialog&quot; aria-labelledby=&quot;resetModal&quot; aria-hidden=&quot;true&quot;&gt;
    &lt;div class=&quot;modal-dialog&quot; role=&quot;document&quot;&gt;
      &lt;div class=&quot;modal-content&quot;&gt;
        &lt;div class=&quot;modal-header&quot;&gt;
          &lt;h5 class=&quot;modal-title&quot; id=&quot;exampleModalLabel&quot;&gt;Reset Password&lt;/h5&gt;
          &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot; aria-label=&quot;Close&quot;&gt;
            &lt;span aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/span&gt;
          &lt;/button&gt;
        &lt;/div&gt;
        &lt;div class=&quot;modal-body&quot;&gt;
          &lt;form action=&quot;/admin/{id}/reset/password&quot; method=&quot;POST&quot;&gt;
            {{csrf_field()}}
            {{ method_field('PUT') }}
            &lt;div class=&quot;form-group&quot;&gt;
              &lt;label for=&quot;password&quot;&gt;Password Baru&lt;/label&gt;
              &lt;input name=&quot;new_password&quot; type=&quot;password&quot; class=&quot;form-control&quot; id=&quot;new_password&quot; required&gt;
            &lt;/div&gt;
            &lt;div class=&quot;form-group&quot;&gt;
              &lt;label for=&quot;password&quot;&gt;Confirm Password&lt;/label&gt;
              &lt;input name=&quot;new_confirm_password&quot; type=&quot;password&quot; class=&quot;form-control&quot; id=&quot;new_confirm_password&quot; required&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class=&quot;modal-footer&quot;&gt;
            &lt;button type=&quot;button&quot; class=&quot;btn btn-danger&quot; data-dismiss=&quot;modal&quot;&gt;Tutup&lt;/button&gt;
            &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Buat&lt;/button&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>