KayleeDebo wrote a reply+100 XP
3mos ago
You might want to write a Action Class for reusable code. (https://rezakhademix.medium.com/what-are-laravel-action-classes-and-how-to-use-them-253217c43b06)
Service class (with static functions) might also be right for your use case.
Repeating your code is always bad practice, try to resolve duplicate code by deciding what 'domain' it belongs to and write a appropriate Class object/function name.