Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

pmcrealcor's avatar

Tips for building a FAST Restfull API with Laravel

Hi All, I'm struggling with a "problem" that I'll try to describe shortly (forgive me if my English isn't perfect). I'm currently working with a base-code, developed with Laravel, that I need to optimize. It's an RESTfull API that retrieves JSON, and uses 2 external packages a) to handle API Request (filter, order and pagination) and b) use Fractal Transformer to build Responses. The main problem is - the API is slow! It takes forever to retrieve a list of employees, even if its limited to just 10 elements per page. I've tried to debug, and it seems that the task that is more time-consuming is the fractal transformer. (If needed, I'll comment with more details) What would you do to build a fast API using Laravel? What tips and tricks come to mind to guarantee speed?

0 likes
5 replies
jcmargentina's avatar

bro. something os wrong. it cannot take forever yo get 10 items.

best thing to do .... debug

Cronix's avatar

Is this api yours, or are you using a 3rd parties api?

pmcrealcor's avatar

@Cronix - It's not mine as The Author, but it is mine as The owner, meaning I have full access to the API code.

Please or to participate in this conversation.