Answer the question
In order to leave comments, you need to log in
Is it necessary to create a separate controller for an API in Laravel?
Question on Laravel 7. I need to make only two methods via API: is and replace.
Do I need to make a separate controller, or can they be stuffed into an existing one that the web serves?
It is clear that it is better to create. But I would like to hear specific reasons.
Well, there are 404 error codes in JSON, for example, to give.
Answer the question
In order to leave comments, you need to log in
No, not "necessarily".
Laravel is also optional, you can use regular spaghetti.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question