Advertisement
Ankit_pastebin

Untitled

Nov 10th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Http\Middleware;
  4.  
  5. use Closure;
  6. use \Illuminate\Support\Facades\Session;
  7. use \Illuminate\Support\Facades\Log;
  8.  
  9. class LogMiddleware
  10. {
  11.     /**
  12.      * Handle an incoming request.
  13.      *
  14.      * @param  \Illuminate\Http\Request  $request
  15.      * @param  \Closure  $next
  16.      * @return mixed
  17.      */
  18.   
  19.     public function handle($request, Closure $next)
  20.     {
  21.         return $next($request);
  22.     }
  23.  
  24.     public function terminate($request, $response)
  25.     {
  26.        // Log::info('app.requests', ['request' => $request->all(), 'response' => $response]);
  27.         Log::info('app.requests', ['route'=>$request->route()->getPath(),'request' => $request->all()]);
  28.     }
  29.     
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement