@MANOJOW - Not sure if there's going to be a better way to do it unless you use Eloquent to setup proper relationships between the two tables so you can do something like:
$local->units
Then you wouldn't have to worry about pulling a string of unit_ids then exploding them into an array. Either way though, just for clarification, you aren't working with the Query builder here anymore since you get(), at that point you're working with a collection so technically this would be the same thing: