As stated in the documentation, the auth()
function can be used instead of the Auth
facade, returns an authenticator instance and can be used like this:
auth()->check()
auth()->guest()
auth()->id()
auth()->user()
As you can see - I can chain ->check()
or ->guest()
or ->id()
or ->user()
.
Is it possible to add a new custom function that can be also chaned? For example, somethingNew()
that can be used like this:
auth()->somethingNew() // returns boolean