Skip to content

Commit 5cfa033

Browse files
committed
added a helpers
1 parent 0e41940 commit 5cfa033

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
"autoload": {
2424
"psr-4": {
2525
"PulkitJalan\\GeoIP\\": "src"
26-
}
26+
},
27+
"files": [
28+
"helpers.php"
29+
]
2730
},
2831
"extra": {
2932
"branch-alias": {

helpers.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
if (! function_exists('geoip')) {
4+
/**
5+
* Get an instance of the current geoip.
6+
*
7+
* @return \PulkitJalan\GeoIP\GeoIP
8+
*/
9+
function geoip($key = null)
10+
{
11+
if (is_null($key)) {
12+
return app('geoip');
13+
}
14+
15+
return $app('geoip')->get.ucwords(camel_case($key));
16+
}
17+
}

0 commit comments

Comments
 (0)