$userId = Auth::id();

Read more of this post