Hi, Where should i keep code or db query which is reusable between different controllers. I want to use same query to show report as html view, export pdf and excel files out of it. if any change in future so i will update only in one place. query is joined multiple tables and models.
Same is for code. I am using same code to calculate some rewards and code has calculation formula where should i keep that also to change or update it from one place.
@martinbean Thanks for the reply where we will keep these classes, do we need create separate directory manually under app directory or we can do this with artisan command? and example will be really helpful.