Laravel.io
return $this->model->with('mills.pulp')
        ->whereHas('mills', function($query) use ($gradeIds) {
            $query->whereHas('pulp', function ($query) use ($gradeIds) {
                $query->whereIn('grade_id', $gradeIds);
            });
        })->get();

Please note that all pasted data is publicly available.