Lecturize / Laravel-Addresses

Simple address and contact management for Laravel.
MIT License
197 stars 39 forks source link

HasContacts::flushAddresses() bug (typo) #22

Closed mbroadhead closed 3 years ago

mbroadhead commented 4 years ago

The flushContacts method is calling contactes when it should be calling the correctly named contacts morphMany relationship method.

Patch to fix:

--- /tmp/HasContacts.php    2019-12-31 13:44:18.000000000 -0700
+++ /tmp/HasContacts.php2   2019-12-31 13:44:54.000000000 -0700
@@ -77,13 +77,13 @@
     }

     /**
-     * Deletes all the contactes of this model.
+     * Deletes all the contacts of this model.
      *
      * @return bool
      */
     public function flushContacts()
     {
-        return $this->contactes()->delete();
+        return $this->contacts()->delete();
     }

     /**
@@ -120,4 +120,4 @@

         return validator($attributes, $rules);
     }
-}
\ No newline at end of file
+}

I'll create a PR for this when I have time.