Hello, i have a project front,admin and api . i want to know where to put the logic to be shared between the three parts . i will not use repository . i mean like functions that check or return data and so in api controller return it as json and in others return it with view.
In our projects, we use a "service layer" - basically any shared business logic gets put into \App\Services\WhateverService.php.
That way we can use this service in multiple controllers to prevent code being duplicated.
If, for example, a controller was called InteractionController, we would name the service InteractionService and inject it into the controller, and any other controller it was required in.