This commit is contained in:
F4ilji
2025-04-23 17:53:22 +05:00
parent bd3922c0b5
commit 43e59e8838
2 changed files with 15 additions and 22 deletions
@@ -53,9 +53,9 @@ class ClientAdditionalEducationController extends Controller
->WithActivePrograms()
->where('is_active', true)
->when($request->input('form'), function ($q, $form) {
$q->whereHas('additionalEducations', function ($q) use ($form) {
$q->where('form_education', FormEducation::fromName($form)->value);
});
$formValue = FormEducation::fromName($form)->value;
$q->whereHas('additionalEducations', fn ($q) => $q->where('form_education', $formValue))
->with(['additionalEducations' => fn ($q) => $q->where('form_education', $formValue)]);
})
->when($request->input('category'), function($q, $slugs) {
$q->whereIn('slug', $slugs);