This will work:
DiscussionCategory::where('slug', $slug)->with('discussions.author')->paginate(25)
Set foreign key on the relation:
// Discussion model, the same applies to the Category model
public function category()
{
return $this->belongsTo('Umc\Models\DiscussionCategory', 'category_id');
}
Paginating discussions:
$category = DiscussionCategory::where('slug', $slug)->first();
$discussions = $category->discussions()->paginate(25);
$discussions->load('author'); // eager load authors on the collection