All Tag: php Posts
Craig Riley
5 months ago - Development
Inverse BelongsToThrough relationships in Laravel models
No, Laravel doesn’t actually have a BelongsToThrough relationship, a common frustration for models where you want to access the top level of a BelongsTo chain. Consider this setup: A user has authored many posts. Those posts have many reviews. So how do we define the inverse relationship back up from Review -> User (the post...