Check out example codes for "laravel get auth user id". It will help you in understanding the concepts better.

Code Example 1

// Get the currently authenticated user's ID...
$id = Auth::id();

Code Example 2

$userId = Auth::id();

Learn ReactJs, React Native from akashmittal.com