$promises = Http::pool(function (Pool $pool) use ($schoolId, $filter, $batch, $studentGroupId) {
$pool->as('schoolStaff')->withToken(Auth::user()->token())
->get(Api::schoolStaff()->index($schoolId, [], true), $filter);
$pool->as('schoolBatchStudentGroup')->withToken(Auth::user()->token())
->get(Api::schoolBatchStudentGroup()->detail($schoolId, $batch, $studentGroupId, true));
});
$staffDatas = json_decode($promises['schoolStaff']->getBody(), true)['data'] ?? [];
$studentGroup = json_decode($promises['schoolBatchStudentGroup']->getBody(), true)['data'] ?? [];
Comments