Premium Members Only
This advanced tutorial is available exclusively to Laravel Daily Premium members.
Already a member? Login here
Premium membership includes:
Comments & Discussion
Thanks for such a useful article! Why not to use static methods in Service classes? In general, when and where should we use static methods?
It's a debatable thing, static methods usually mean that there's no specific object of that service/class and method doesn't rely on any other variables than itself.
In most cases, you CAN use static methods, but a general advice is that if you don't have specific reason to use static methods, you should not use them, as they may cause confusion in the future, potentially.
I guess it's worth separate article and video, adding to my to-do list.
Hello sir,
I'd like to know your recommendations about the best way to use UserService to handle Staff, Parent, Student, Vendor which belongTo 1 user; so that anytime any basic data info updated on User, the related Staff/Parent/Student/Vendor basic info also updated, and vice versa.
how to use interfaces with the service file ?