Exemplo n.º 1
0
 public function handle($request, Closure $next)
 {
     $guest = new Guest();
     $ip = $request->ip();
     $check_guest = Guest::where('ip_address', $ip)->count();
     if ($check_guest == 0) {
         $guest->ip_address = $ip;
         $guest->save();
     }
     return $next($request);
     //return var_dump($check_guest);
 }
Exemplo n.º 2
0
 public function __construct()
 {
     $this->middleware('admin');
     $this->data['guest'] = Guest::all()->count();
 }