Where should I put hits?

Posted 3 years ago by Mithridates

I'm developing an api following laracasts series
I have these two methods:

public function transformCollection($venues)
    {
        return array_map([$this, 'transform'], $venues->toArray());
    }

    public function transform(Array $venue)
    {
        return [
            'name'    => $venue['name'],
            'address' => $venue['address']
        ];
    }

Which necessarily converts a model to array with custom names.
Right now I've put them in DbVenueRepository which is implementation of VenueRepository.
But I don't like to keep em there. Where to move them

Please sign in or create an account to participate in this conversation.