I am sorry for the dumb question, but I am new at this programming thing and having fun. How do I get the current user in a base Laravel Spark project? I know what the Laravel Spark documentation says, but I can't seem to get the information even with that. I guess I just need an example. Any help would be appreciated. :)
Asked
Active
Viewed 1,809 times
1 Answers
7
you can access the current authorized user by using the Auth facade. $user = Auth::user();
Make sure to add use Auth;
at the top of your file!
Adding on top of this, if you just need something small like the logged-in users's ID, you can say Auth::id()

dargue3
- 2,802
- 2
- 14
- 23
-
Works like a charm. Thanks so much! – TytonDon Jun 18 '16 at 00:17