Hi,
I've asked a similar question long time ago, so from the answers there didn't seem to be a conclusive answer.
I have repeating code that is specific to a controller.
For example, constructing a string from input and validating it, or a repeating query that isn't used directly by a route.
What I do right now is I simply create functions inside the controller, sometimes without passing the $request to them, and sometimes passing it for the data. I then call these functions from inside the controller:
$result = $this->some_function();
It's working, but would you do something else? I feel like I should not put them in another folder like app/Support or similar folder because these functions are controller-specific
But I also feel like it's "polluting" the code
Should I do something else or just leave it like that?.
Thanks