I have a collection like this

```
$collection = [
    1 => [
        ...
    ],
    2 => [
        ...
    ],
    3 = [
        ...
    ]
];

```

And array by what i want to sort it

```
$sort =[
    3, 1, 2
];

```

I am trying to realise how i can sort my `$collection` with code like this

```
$collection->sortBy(function($unit, $id) use ($sort) {
     return ...;
})

```

But can't figure it myself, i already have working example, where i just foreach all $collection elements, and assign them some int by what i can sort "normally", but it still interesting for me if it possible to sort by another array without assigning additional keys to collection elements.