2

I know how facades work and I can find full facade list in Laravel: https://laravel.com/api/5.2/Illuminate/Support/Facades.html

But how I can see all available functions for each facade?

If I use the Session Facade I can:

  1. Find methods in laravel documentation -- https://laravel.com/docs/5.2/session
  2. Search methods in each class in the Illuminate/Session namespace --https://laravel.com/api/5.2/Illuminate/Session.html

Is there a more elegant way to find the available functions?

0

3 Answers 3

1

It's a bit of work to find the underlying implementation of the Facade service, but it can be done. Starting with the actual Facade, it has a method called getFacadeAccessor which returns a string.

In turn, this string is mapped to a class name inside Application.php in registerCoreContainerAliases.

To learn more, this post provides a source code walk-through.

Sign up to request clarification or add additional context in comments.

Comments

0

Look here. But I would always take the minute and look into the source ;)

BTW. You could also use the PHP method get_class_methods()

Comments

0

The link you posted (https://laravel.com/api/5.2/Illuminate/Support/Facades.html) is probably the best way to do it. There's no "more elegant" way than using documentation provided by the code's author.

Another resource you could possibly leverage, which gives you the class name behind the Facade and a link to its documentation, is here: https://laravel.com/docs/5.2/facades#facade-class-reference

There's a version selector at the top of that page so you can find your version.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.