Skip to content

Commit c091dd4

Browse files
committed
fix: thana filtering depending on district
1 parent 15d4555 commit c091dd4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

app/Http/Controllers/Frontend/Page/PageController.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function appointmentPage(Request $request, ?ExpertProfile $expertProfile
5959
}
6060
$office = !empty($request->query('office_id')) ? Map::find($request->query('office_id')) : null;
6161
$admin = User::role('super admin')->first();
62-
$defaultDistrict = $expertProfile != null ? $request->query('branch-district', 'Chattogram') : null;
62+
$defaultDistrict = $request->query('branch-district', 'Chattogram');
6363
if ($office == null) {
6464
$maps = Map::where(function (Builder $q) use ($request, $expertProfile, $admin, $defaultDistrict) {
6565
if ($request->query('branch-thana')) {
@@ -135,8 +135,8 @@ public function officePage(Request $request)
135135
{
136136
$admin = User::role('super admin')->first();
137137
$maps = Map::where(function (Builder $q) use ($request, $admin) {
138-
if ($request->query('thana', 'Karnaphuli')) {
139-
$q->where('thana', $request->query('thana', 'Karnaphuli'));
138+
if ($request->query('thana')) {
139+
$q->where('thana', $request->query('thana'));
140140
}
141141
if ($request->query('district', 'Chattogram')) {
142142
$q->where('district', $request->query('district', 'Chattogram'));

resources/views/frontend/pages/appointment/makeAppointment.blade.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class="text-muted fs-6">(selected)</span></h5>
149149
<div class="mb-2">
150150
<label for="branch-thana">District <span
151151
class="text-danger">*</span></label>
152-
<select class="tail-select hx-include !w-full"
152+
<select class="hx-include !w-full"
153153
hx-get="{{ $expertProfile ?? false ? route('consultation.make', ['expertProfile' => $expertProfile]) : route('appointment.make') }}"
154154
hx-select="#hx-filter-target" hx-include=".hx-include"
155155
hx-target="#hx-filter-target" hx-swap="outerHTML"
@@ -168,7 +168,7 @@ class="text-danger">*</span></label>
168168
<div class="mb-2" id="hx-branch-thanas" hx-swap-oob="true">
169169
<label for="branch-thana">Thana <span
170170
class="text-danger">*</span></label>
171-
<select class="tail-select hx-include !w-full"
171+
<select class="hx-include !w-full"
172172
hx-get="{{ $expertProfile ?? false ? route('consultation.make', ['expertProfile' => $expertProfile]) : route('appointment.make') }}"
173173
hx-select="#hx-filter-target" hx-include=".hx-include"
174174
hx-target="#hx-filter-target" hx-swap="outerHTML"

resources/views/frontend/pages/office.blade.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="col-md-6">
2424
<div>
2525
<label for="branch-thana">District: </label>
26-
<select class="tail-select hx-include" hx-include=".hx-include"
26+
<select class=" hx-include" hx-include=".hx-include"
2727
hx-get="{{ route('office') }}" hx-select="#hx-filter-target"
2828
hx-target="#hx-filter-target" hx-swap="outerHTML" label="Select District"
2929
id="branch-district" name="district" placeholder="Select District...">
@@ -37,7 +37,7 @@
3737
<div class="col-md-6">
3838
<div class="mb-2" id="thanas" hx-swap-oob="true">
3939
<label for="branch-thana">Thana: </label>
40-
<select class="tail-select hx-include" hx-include=".hx-include"
40+
<select class=" hx-include" hx-include=".hx-include"
4141
hx-get={{ route('office') }} hx-select="#hx-filter-target"
4242
hx-target="#hx-filter-target" hx-swap="outerHTML" id="branch-thana" name="thana"
4343
placeholder="Select Thana...">

0 commit comments

Comments
 (0)