Skip to content

Commit

Permalink
✨ expose ip and geoip functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
acidjazz committed Sep 2, 2020
1 parent 0c4b7f6 commit 294d477
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Guards/HumbleGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function login(Authenticatable $user, string $source = null)
*
* @return array|string|null
*/
private function ip()
public function ip()
{
return request()->header('X-Forwarded-For') ?: request()->ip();
}
Expand All @@ -119,7 +119,7 @@ private function ip()
* Return a cleaned up GeoIP result
* @return array
*/
private function geoip()
public function geoip()
{
$loc = geoip($this->ip())->toArray();
unset($loc['iso_code'], $loc['continent'], $loc['state_name'], $loc['default'], $loc['cached']);
Expand Down

0 comments on commit 294d477

Please sign in to comment.