title: Set key to difference key when get laravel relationship
body: <p>I want to change my collection array key to language code.</p>
  
  <p>Here is my code</p>
  
  <pre><code>$products = Product::has('languages')-&gt;paginate(20);
          return response()-&gt;json($products);
  </code></pre>
  
  <p>This is my relationship</p>
  
  <pre><code>public function languages($lang_id = null)
  {
      if ($lang_id)
          return $this-&gt;hasMany(ProductLang::class)-&gt;where('lang_id', $lang_id)-&gt;first();
      return $this-&gt;hasMany(ProductLang::class);
  }
  </code></pre>
  
  <p>This is what I get for now.</p>
  
  <pre><code>Illuminate\Database\Eloquent\Collection {#613 ▼
      #items: array:2 [▼
          0 =&gt; App\Models\Product\ProductLang {#614 ▶}
          1 =&gt; App\Models\Product\ProductLang {#615 ▶}
      ]
  }
  </code></pre>
  
  <p>Expected:</p>
  
  <pre><code>Illuminate\Database\Eloquent\Collection {#613 ▼
      #items: array:2 [▼
          en =&gt; App\Models\Product\ProductLang {#614 ▶}
          zh =&gt; App\Models\Product\ProductLang {#615 ▶}
      ]
  }
  </code></pre>
  
  <p>Thanks for any help..</p>