Laravel with with where eloquent

Solution:

Correct syntax for with() is:

public function getGroupCategories() {

    $group_categories = GroupCategory::with(['groupCategoriesTranslation' => function($query){
        $query->where('code', 'en');
    }]);

    return $group_categories;
}