Answers
In your Post.php Model
public function checkFavourites()
{
if($this->favourite) {
return $this->favourite->count() && auth()->user()->id == $this->favourite->user_id;
}
}
- The problem is still there, do you think this problem is not due to relationships? If so, how should I write it, assuming that this table is supposed to be connected to several models?– johnDoe220Apr 30 at 8:53
- As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.– CommunityBotMay 2 at 4:22
Add a comment