I am making a voting system for a link sharing website I am working on.
When a user votes on a link as a new row is added to the db with the link id and user id.
When showing these links in my controller I call a relationship (votes):
$links = Link::orderBy('created_at', 'desc')->with('votes')->paginate(20);
public function votes()