title: remove duplicates from an array when using laravel eloquent relationship in vuejs
body: <p>So I have an array that has an object inside of it due to eloquent relationship in laravel. So the array looks something like this:</p>
  <p>Documents:</p>
  <pre><code>[
      {
          &quot;id&quot;: 6,
          &quot;name&quot;: &quot;document&quot;,
          &quot;supplier&quot;: {
              &quot;id&quot;: 5,
              &quot;name&quot;: &quot;H.B.C&quot;,
          }
      },
      {
          &quot;id&quot;: 5,
          &quot;name&quot;: &quot;document&quot;,
          &quot;supplier&quot;: {
              &quot;id&quot;: 5,
              &quot;name&quot;: &quot;H.B.C&quot;,
          }
      },
      {
          &quot;id&quot;: 4,
          &quot;name&quot;: &quot;document&quot;,
          &quot;supplier&quot;: {
              &quot;id&quot;: 4,
              &quot;name&quot;: &quot;Avrora&quot;,
          }
      }
  ]
  </code></pre>
  <p>Now I'm trying to use lodash to get unique suppliers so in the above example I would want to get back
  H.B.C and Avrora without another H.B.C.</p>
  <p>What I'm trying:</p>
  <pre><code>CollectionSuppliers () {
      return uniq(this.Documents.supplier.map(({ name }) =&gt; name))
  },
  </code></pre>
  <p>but im getting an error:</p>
  <pre><code>Cannot read properties of undefined (reading 'map')
  </code></pre>