Commit 347c20a 1 parent e5f007c commit 347c20a Copy full SHA for 347c20a
File tree 1 file changed +13
-0
lines changed
app/Http/Controllers/Backend
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 14
14
15
15
class UserAppointmentController extends Controller
16
16
{
17
+ public function __construct () {
18
+ if (request ('type ' ) != 'consultation ' ){
19
+ if (!auth ()->user ()->hasRole ('super admin ' )){
20
+ abort (403 , 'You don \'t have access to this page ' );
21
+ }
22
+ }
23
+ }
17
24
public function index ()
18
25
{
19
26
$ expert = auth ()->user ()->expertProfile ;
@@ -24,6 +31,8 @@ public function index()
24
31
if ($ expert != null ) {
25
32
$ q ->where ('expert_profile_id ' , $ expert ->id );
26
33
}
34
+ }{
35
+ $ q ->whereNull ('expert_profile_id ' );
27
36
}
28
37
})
29
38
->with ('map ' , 'user ' )->latest ()->paginate (paginateCount ());
@@ -78,6 +87,8 @@ public function approvedList()
78
87
if ($ expert != null ) {
79
88
$ q ->where ('expert_profile_id ' , $ expert ->id );
80
89
}
90
+ }{
91
+ $ q ->whereNull ('expert_profile_id ' );
81
92
}
82
93
})
83
94
->with ('map ' , 'user ' )->latest ('approved_at ' )->get ();
@@ -95,6 +106,8 @@ public function completedList()
95
106
if ($ expert != null ) {
96
107
$ q ->where ('expert_profile_id ' , $ expert ->id );
97
108
}
109
+ }{
110
+ $ q ->whereNull ('expert_profile_id ' );
98
111
}
99
112
})
100
113
->with ('map ' , 'user ' )->latest ('completed_at ' )->get ();
You can’t perform that action at this time.
0 commit comments