0👍
Have You Tried \Auth::id()
. ?
This should work I think.
- [Vuejs]-Function returning true despite promise evaluating to false
- [Vuejs]-Config nginx for Vue.js distribute project
0👍
These helper methods will only retrieve the authenticated user or id if an user is actively logged in and if the controller method is wrapped with the auth
middleware. If not they’ll just return null.
\Auth::id();
auth()->id();
- [Vuejs]-Vue.js (Mocha/Chai/Sinon) component unit test expectation failing
- [Vuejs]-Vue Component inside table
0👍
$user = auth()->user();
then
$optionElection->user_id = $user->id
;
Source:stackexchange.com