Most commonly, you would duplicate for blade views and for API responses.
If you can identify reasonable blocks of business logic, you could create action classes that you call from either place to perform the common action.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am starting a new project and considering to use TALL stack. I will also need an api to consume from a mobile app. What is the best way to have both TALL and an API? Should I abstract business logic with classes and call these methods from both livewire and api or just duplicate everything?
Please or to participate in this conversation.