Skip to content

Commit d07d090

Browse files
committed
fix: url
1 parent 1118fa8 commit d07d090

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

app/Helper/helper.php

+19
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,22 @@ function currencyFormat(mixed $value): string {
346346

347347
return '৳ '.$formatter->format($value);
348348
}
349+
350+
function routeWithQuery(string $name, mixed $params = []){
351+
$queryStrings = '';
352+
$count = 0;
353+
if (count(request()->query()) > 0) {
354+
$queryStrings = '?';
355+
$queryStrings .= http_build_query(request()->query());
356+
357+
return route(
358+
$name,
359+
$params
360+
).$queryStrings;
361+
}
362+
363+
return route(
364+
$name,
365+
$params
366+
);
367+
}

resources/views/backend/layouts/sidebar.blade.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -742,17 +742,17 @@
742742
<ul class="nav-second-level">
743743
@canany(['update appointment', 'approve appointment', 'read appointment'])
744744
<li>
745-
<a href="{{ route('user-appointments.index') }}">
745+
<a href="{{ request('map_id') ? routeWithQuery('user-appointments.index') : route('user-appointments.index') }}">
746746
Pending For Approval
747747
</a>
748748
</li>
749749
<li>
750-
<a href="{{ route('user-appointments.approved') }}">
750+
<a href="{{ request('map_id') ? routeWithQuery('user-appointments.approved') : route('user-appointments.approved') }}">
751751
Approved
752752
</a>
753753
</li>
754754
<li>
755-
<a href="{{ route('user-appointments.completed') }}">
755+
<a href="{{ request('map_id') ? routeWithQuery('user-appointments.completed') : route('user-appointments.completed') }}">
756756
Completed
757757
</a>
758758
</li>
@@ -780,26 +780,26 @@
780780
<ul class="nav-second-level">
781781
@canany(['update consultation', 'approve consultation', 'read consultation'])
782782
<li>
783-
<a href="{{ route('user-appointments.index') . '?type=consultation' }}">
783+
<a href="{{ route('user-appointments.index', ['type'=> 'consultation'])}}">
784784
Pending For Approval
785785
</a>
786786
</li>
787787
<li>
788788
<a
789-
href="{{ route('user-appointments.approved') . '?type=consultation' }}">
789+
href="{{ route('user-appointments.approved', ['type'=> 'consultation'])}}">
790790
Approved
791791
</a>
792792
</li>
793793
<li>
794794
<a
795-
href="{{ route('user-appointments.completed') . '?type=consultation' }}">
795+
href="{{ route('user-appointments.completed', ['type'=> 'consultation'])}}">
796796
Completed
797797
</a>
798798
</li>
799799
@if (auth()->user()->role_name == 'expert')
800800
<li>
801801
<a
802-
href="{{ route('user-appointments.times') . '?type=consultation' }}">
802+
href="{{ route('user-appointments.times', ['type'=> 'consultation'])}}">
803803
Appointment Times
804804
</a>
805805
</li>

0 commit comments

Comments
 (0)