overtrue / laravel-like

👍 User-like features for Laravel Application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Likes relationship

kuvallini opened this issue · comments

I would recommend to add likes relationship:

public function likes(): \Illuminate\Database\Eloquent\Relations\MorphMany
{
    return $this->morphMany(config('like.like_model'), 'likeable');
}

In the same way as you did in Favorites. It is useful for delete all linked likes to the object, etc.

huh, thank you for such wonderful package