4 months ago

Call to undefined relationship [videolikes] on model [App\Videopost].

Posted 4 months ago by MadMaks

Hi, i get this error message and don't know why, maybe you could help me out. Thanks in advance.

$productionPosts = Videopost::where('category' , 'Production')

this is my user model

public function likesVideo()
        return $this->belongsToMany(Videopost::class , 'videolikes')->withTimestamps();

and this is my videopost model

public function hasVideoLikes()
        return $this->belongsToMany(User::class , 'videolikes')->withTimestamps();

Please sign in or create an account to participate in this conversation.