Auth()->user()->id;

PHP
$userId = Auth::id();
Source

Also in PHP: