0

Difference between service & trait in Laravel

Assume I have a class which handles image uploading on my application Should I write it as service or trait ? when i should use service and trait ?

Red Coder
  • 1
  • 1

1 Answers1

0

A service is a class that will be called during your file manipulation.

A trait is an extension of a class, that you can incorporate in other classes.

The choice is yours, I hope I understood you well. Sincerely