You could do this through traits where both Post and User would use the trait 'Likeable' to effectively implement the "direct" query once in the trait itself.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community