Looking for suggestions on the best way to store addresses.
Currently I have many models that need addresses so I decided to use the One To One (Polymorphic) relationship
public function address()
{
return $this->morphOne('App\Address','imageable');
}
but I'm not sure this is the best way to store this data since I anticipate many redundant entries which isn't good use of storage. What have others done to use a single entry in the database with a list of imageable ids who leverage that address.
Usually, I store it on the same model, like Company or whatever model that address belongs to.
I had only one use case where I needed only one version of a specific address to exist and it was a foreign key that was used by many models. If that is the case for you, then do something firstOrCreate() for addresses.