mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
33 lines
819 B
PHP
33 lines
819 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class LogRequestPathMiddleware
|
|
{
|
|
/**
|
|
* Handle an incoming request.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param \Closure $next
|
|
* @return mixed
|
|
*/
|
|
public function handle(Request $request, Closure $next)
|
|
{
|
|
$method = $request->method();
|
|
Log::channel('request_path')->info('Request Method: ' . $method);
|
|
$fullUrl = $request->fullUrl();
|
|
Log::channel('request_path')->info('Request URL: ' . $fullUrl);
|
|
|
|
if ($request->isMethod('post')) {
|
|
$payload = $request->all();
|
|
Log::channel('request_path')->info('Request Payload POST: ', $payload);
|
|
}
|
|
|
|
return $next($request);
|
|
}
|
|
}
|