Skip to content

Commit 0b1007c

Browse files
committed
Refactor example usage
1 parent 4ac5663 commit 0b1007c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ class UserController extends Controller
4141
$user->name = $request->name;
4242

4343
// $request->country() will perform geolocation, and return a detailed country object.
44+
$country = $request->country();
4445

45-
$user->countryName = $request->country()->name;
46-
$user->countryCode = $request->country()->isoCodeAlpha3;
46+
$user->countryName = $country->name;
47+
$user->countryCode = $country->isoCodeAlpha3;
4748

4849
$user->save();
4950

0 commit comments

Comments
 (0)