From inside a controller, you can access the logged-in user via the global helper auth()->user() or the facade Auth::user(). Not sure what you mean by "without submitting the request."
Jan 22, 2018
7
Level 1
Query
I have one problem I want whenever user login one table should show the list of client of his department. how can I pass the user department value to my controller without submitting the request
Level 1
Thank-you very much for your clue I got the soultions
$npt= Patient::whereHas('departmetrel', function ($query) { $query->where('department_department_id', '>=', Sentinel::getUser()->depart); })->get();
Collection {#390 ▼
#items: array:3 [▼
0 => patient {#391 ▶}
1 => patient {#373 ▶}
2 => patient {#392 ▶}
]
}
´´´
And i got this answer hope can help others
Please or to participate in this conversation.