diff --git a/security/guard_authentication.rst b/security/guard_authentication.rst index 67e2f5e8d47..c06f33566db 100644 --- a/security/guard_authentication.rst +++ b/security/guard_authentication.rst @@ -69,6 +69,13 @@ property they use to access their account via the API:: } // more getters/setters + + // it's recommended to add this method so you can later pass the + // user object to other methods instead of their username + public function __toString() + { + return $this->username; + } } .. tip::