user ? $request->user->id : null; $method = $request->getMethod(); $path = $request->getPathInfo(); Log::debug('User ' . $userId . ' hitting ' . $method . ' ' . $path . ' endpoint', [ 'user' => $userId, 'method' => $method, 'path' => $path, 'input' => array_filter($request->input(), function ($key) { return $key !== 'user'; }, ARRAY_FILTER_USE_KEY) ]); return $next($request); } }