Skip to content

Commit b7125ba

Browse files
committed
fix:map update issuse
1 parent 0f1d7f4 commit b7125ba

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/Http/Controllers/Backend/Map/MapController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function update(UpdateMapRequest $request, Map $map)
9090
$map->district = $request->district;
9191
$map->thana = $request->thana !== null ? $request->thana : $map->thana;
9292
$map->address = $request->address;
93-
$map->src = $request->src;
93+
$map->src = $src;
9494
$map->update();
9595

9696
$notification = array(

app/Http/Requests/UpdateMapRequest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function rules(): array
2323
{
2424
return [
2525
'district' => ['string', 'required'],
26-
'thana' => ['string', 'required'],
26+
'thana' => ['string', 'nullable'],
2727
'location' => ['string', 'required'],
2828
'address' => ['string', 'required'],
2929
'iframe_link' => ['required', 'string', 'regex:/https:\/\/www\.google\.com\/maps\/embed/i'],

resources/views/backend/map/editMap.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<label for="thana">Thana</label>
4545
<select id="thana" name="thana" placeholder="Select Thana...">
4646
@foreach ($defaultThanas as $thana)
47-
<option value="{{ $thana }}" @selected($thana === $map->thana)>
47+
<option value="{{ $thana }}" @selected(trim($thana) == trim($map->thana))>
4848
{{ $thana }}</option>
4949
@endforeach
5050
</select>

0 commit comments

Comments
 (0)