get limit from Relationship Laravel

Solution:

Accessing a relationship like a method (i.e. $category->posts()) will give you a query builder, on which you can chain methods:

$firstFourPosts = $category->posts()->take(4)->get();