Level 3
Create a function in your user model ... likesPlace(place_id)
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How do I check if a particular relation exists between two models?
I have two models User and Place I have three tables, users, places and place_user
A User can like many Places and a Place can be liked by many Users.
How do I check if a Place is liked by a particular user?
Create a function in your user model ... likesPlace(place_id)
Please or to participate in this conversation.