private function getOrderValueForTags($tags)
{
$q = $this->media()->newPivotStatement();
$tags = (array) $tags;
$grammar = $q->getConnection()->getQueryGrammar();
$result = $q->selectRaw($grammar->wrap('tag') . ', max(' . $grammar->wrap('order') . ') as aggregate')->where('mediable_type', $this->getMorphClass())->where('mediable_id', $this->getKey())->whereIn('tag', $tags)->groupBy('tag')->pluck('aggregate', 'tag');
$empty = array_combine($tags, array_fill(0, count($tags), 0));
return array_merge($empty, collect($result)->toArray());
}