dimanche 6 janvier 2019

How to add new (custom) function that can be chained with the auth() function

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



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2s9PgDK
via IFTTT

Aucun commentaire:

Enregistrer un commentaire