title: How to know if model has changed after submit a form in Laravel 5.5?
body: <p>I have a view with a form where the user can change his name. After submit the form, I need to know if the name has changed or not.
  At this momment, the code result allways in false (no changes), but the database table is updated correctly.</p>
  
  <p>My User model has:</p>
  
  <pre><code>   protected static function hasChanged()
  {
      self::updating(function($user){
        if($user-&gt;isDirty())
        {
              return true;
        }else
        {
            return false;
        }
  
      });
  }
  </code></pre>
  
  <p>My ProfileController received the data in form.</p>
  
  <pre><code>    public function updateProfile(Request $request)
  {
      $usuario = new User;
      User::find(Auth::user()-&gt;id)-&gt;update($request-&gt;all());
      $message = User::hasChanged() ? "Data changed" : "No data changed";
      return redirect('home')-&gt;with('success', $message); 
  }
  </code></pre>
  
  <p>In $message allways get "No data changed", in spite of user has changed the data  in the form. </p>
  
  <p>I don't know if this is the best way to do it.</p>
  
  <p>Thanks for help me.</p>