how to merge two array, and then short the resultant array as merged array values comes first irrelative to key values
<p>$community gets all the communities.
$starred communities gets all the starred communities.
And then both of them are merged.</p>

<p><strong>Here is code:</strong></p>

<pre><code>$communities = Community::all();
$starred_communities = StarredCommunity::where('user_id',1)-&gt;get();
$communities = $communities-&gt;merge($starred_communities);
</code></pre>

<p>I want resultant array should get $starred_communities at starting positions. Presently result is being shorted according to the primary keys of both records.</p>