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