get user object by id sql code example Example: get id user login laravel use Auth; $user_id = Auth::user()->id;