From a4ed269c99d3f323a3ca38624bb6929074a8321f Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 3 Aug 2016 13:09:52 +0200 Subject: [PATCH] Added a help note about __toString() method for Guard User classes --- security/guard_authentication.rst | 7 +++++++ 1 file changed, 7 insertions(+) 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::