Im working on my first Laravel project and I have an API, a Backoffice and of course the front end.
For each one I have different controllers and my concern is about what is the best way to improve the code and not repeat it.
For example, on my application for "Create a new commerce" I have 3 ways to do it:
So, I have 3 times the same code. What is the best approach to have the code just once? I think that maybe I need to do all the actions with the API, and call it from Front-end/Backoffice controllers, but how?
Thanks in advance!