Skip to content

Commit 767b3e3

Browse files
committed
finally fix
1 parent 4dc5eb8 commit 767b3e3

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function appointmentPage(Request $request, ?ExpertProfile $expertProfile
6565
if ($defaultDistrict) {
6666
$q->where('district', $defaultDistrict);
6767
}
68-
if ($request->query('dist_only', false) && $request->query('branch-thana')) {
68+
if (!$request->query('dist_only', false) && $request->query('branch-thana')) {
6969
$q->where('thana', $request->query('branch-thana'));
7070
}
7171
if ($expertProfile != null) {
@@ -135,7 +135,7 @@ 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('dist_only', false) && $request->query('thana')) {
138+
if (!$request->query('dist_only', false) && $request->query('thana')) {
139139
$q->where('thana', $request->query('thana'));
140140
}
141141
if ($request->query('district', 'Chattogram')) {

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,14 @@ class="text-muted fs-6">(selected)</span></h5>
147147
</div>
148148
<div class="col-md-6">
149149
<div class="mb-2">
150+
<input type="hidden" name="dist_only" value="1">
151+
150152
<label for="branch-thana">District <span
151153
class="text-danger">*</span></label>
152154
<select class="hx-include !w-full"
153155
hx-get="{{ $expertProfile ?? false ? route('consultation.make', ['expertProfile' => $expertProfile]) : route('appointment.make') }}"
154156
hx-vals="{'dist_only': 'true'}"
155-
hx-select="#hx-filter-target" hx-include=".hx-include"
157+
hx-select="#hx-filter-target" hx-include=".hx-include, [name='dist_only']"
156158
hx-target="#hx-filter-target" hx-swap="outerHTML"
157159
label="Select District" id="branch-district"
158160
name="branch-district" required

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

+8-9
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@
2222
</div>
2323
<div class="col-md-6">
2424
<div class="flex items-center gap-2 mt-3">
25+
<input type="hidden" name="dist_only" value="1">
2526
<label for="branch-thana">District: </label>
26-
<select class="grow hx-include" hx-include=".hx-include"
27-
hx-get="{{ route('office') }}"
28-
hx-vals="{'dist_only': 'true'}"
29-
hx-select="#hx-filter-target"
27+
<select class="grow hx-include" hx-include=".hx-include, [name='dist_only']"
28+
hx-get="{{ route('office') }}" hx-select="#hx-filter-target"
3029
hx-target="#hx-filter-target" hx-swap="outerHTML" label="Select District"
3130
id="branch-district" name="district" placeholder="Select District...">
3231
<option selected disabled value="">Select a district</option>
@@ -40,10 +39,9 @@
4039
<div class="col-md-6">
4140
<div class="mb-2 flex items-center gap-2 mt-3" id="thanas" hx-swap-oob="true">
4241
<label for="branch-thana">Thana: </label>
43-
<select class="grow hx-include" hx-include=".hx-include"
44-
hx-get={{ route('office') }} hx-select="#hx-filter-target"
45-
hx-target="#hx-filter-target" hx-swap="outerHTML" id="branch-thana" name="thana"
46-
placeholder="Select Thana...">
42+
<select class="grow hx-include" hx-include=".hx-include" hx-get={{ route('office') }}
43+
hx-select="#hx-filter-target" hx-target="#hx-filter-target" hx-swap="outerHTML"
44+
id="branch-thana" name="thana" placeholder="Select Thana...">
4745
<option selected disabled value="">Select a thana</option>
4846
@foreach ($thanas as $thana)
4947
<option value="{{ trim($thana) }}" @selected(trim($thana) == request()->query('thana') || trim($thana) == 'Karnaphuli')>
@@ -87,7 +85,8 @@ class="text-dark fw-bold"
8785
</div>
8886
</div>
8987
@else
90-
<div class="col-12 p-10 rounded bg-gray-200 text-center -ml-3">No branches found for selected location</div>
88+
<div class="col-12 p-10 rounded bg-gray-200 text-center -ml-3">No branches found for selected
89+
location</div>
9190
@endif
9291
</div>
9392
</div>

0 commit comments

Comments
 (0)