D
D
d999992021-04-27 15:50:08
Software design
d99999, 2021-04-27 15:50:08

Where should transforms be placed in Services or in controllers?

Service example:

class CommonJobService implements CommonJobServiceInterface
{
    public function getAll(): array
    {
            return (new CommonJobsTransformer)->transform(CommonJob::all()->sortByDESC('id'));
    }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question