louiss0 wrote a comment+100 XP
4mos ago
louiss0 liked a comment+100 XP
4mos ago
There are many ways to go about this.
- Keep it in the controller
- Move the fetch to the model
- Create a service class that you and move the fetch there
- Use some fancy pattern to achieve the result
Which ever you choose, don't make it more complex than you need to. The logic is quite easy to refactor if and when you need to.
Be aware that your API (When you move there) probably should use a JSON Resource
louiss0 wrote a comment+100 XP
4mos ago
@lukedowning19 Did you ever find a new solution to this?