Skip to content

Commit

Permalink
Merge pull request #8 from jprodrigues70/v1.0.2
Browse files Browse the repository at this point in the history
Fix Client constructor
  • Loading branch information
gabrielpeixoto authored May 11, 2020
2 parents eb61634 + 3b289f9 commit 1fd08ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Contracts/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ class Client
public $id;
public $ip;
public $userAgent;
public $key;
public $logKey;
public $url;

public function __construct($request)
{
$this->id = Auth::check() ? Auth::id() : $this->ip;
$this->ip = $request->getClientIp();
$this->id = Auth::check() ? Auth::id() : $this->ip;
$this->userAgent = $request->header('User-Agent');
$this->key = "block_bot:{$this->id}";
$this->logKey = "block_bot:notified:{$this->ip}";
Expand Down

0 comments on commit 1fd08ed

Please sign in to comment.