I have a system contain users, customers, companies, cards and items.
Should I make everyone of them independent API Controller to prevent mistakes or I make one API Controller to all of them
Is this a real application, or something you are doing as a personal project that will never be used publicly?
If you are building a real world application, then you need to take so advice regarding accepting and storing credit card and personal information belonging to users.
Yes, you probably want separate controllers for each of these. It's likely that you will only end up calling two or three end points from a page (I'm guessing your are using vue or some sort of SPA) at the same time. Which isn't too much of a problem.
If you do end up making lots and lots of calls at the same time, then you may want to consider some sort of facade controller.
I would also recommend reading up on REST apis. May also be worth checking to see if there is anything on laracasts video section about creating apis. I'm pretty sure there will be.
As everybody said, do make a separate controller for each, it is referred to as end-point.
users, customers, companies, and items are all valid end-points to have.
There is no reason to ever have an end-point for cards, unless you are working as a financial institution and building an app that does that. Better leave it out of tests system/project as well.
It would be far better to try Stripe / PayPal or any other payment gateway, almost all of them provide a testing system.
@tykus@talinon do you really think that banks do know what they are doing and that only experts work there? I had a chance to have an interview with major Italian bank just to see that they have no clue how things should be done.