In my Laravel REST API project I mainly consume 3rd party APIs. For that, I have a 'Services' folder grouped by modules to send correct parameters to APIs and get the raw data.
I have a calendar API. First I get raw plannings from a 3rd party. I need to filter and restructure this data somehow. I also need to create a calendar (months and days for a calendar year) and inject that events into the calendar days. To keep my CalendarController clean, I need some advices. Shall I consider to use builder pattern? If so, shall I create a new folder in app folder to put that logic? Or shall I put all these logic in the service folder?
I get a raw data, Eliminate free date ranges More filtering e.g removing overlapped events, detecting calendar type (single, multi etc) Extract date ranges to separate days Create a calendar with days Inject events into the calendar's days