Premium Members Only
This advanced tutorial is available exclusively to Laravel Daily Premium members.
Join Premium - $29/month
Already a member? Login here
Premium membership includes:
Access to all premium tutorials
Video and Text Courses
Private Discord Channel
how to use interfaces with the service file ?
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.
Hi, not sure what do you mean by this. Can you add more details about your case?
Specifically what data you are looking to update there and how the database looks like (rought connection/field example)