added filters in additional edu
This commit is contained in:
@@ -52,6 +52,14 @@ class ClientAdditionalEducationController extends Controller
|
||||
->has('additionalEducations')
|
||||
->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);
|
||||
});
|
||||
})
|
||||
->when($request->input('category'), function($q, $slugs) {
|
||||
$q->whereIn('slug', $slugs);
|
||||
})
|
||||
->when($request->direction, function ($q, $direction) use ($request) {
|
||||
return $q->whereHas('direction', fn($query) => $query->where('slug', $direction))
|
||||
->when($request->form, fn($query, $form) => $query->whereHas('additionalEducations', fn($q) => $q->where('form_education', FormEducation::fromName($form))
|
||||
|
||||
@@ -81,7 +81,7 @@ class ClientProgramController extends Controller
|
||||
->when($request->input('budget'), fn($q, $budget) =>
|
||||
$this->applyBudgetFilter($q, $budget))
|
||||
->when($request->input('direction'), fn($q, $slugs) =>
|
||||
is_array($slugs) ? $q->whereIn('slug', $slugs) : $q)
|
||||
is_array($slugs) ? $q->whereIn('slug', $slugs) : $q)
|
||||
->get()
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user