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?

Brandon
  • 4,491
  • 6
  • 38
  • 59
fico7489
  • 7,931
  • 7
  • 55
  • 89

3 Answers3

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.

Ryan
  • 14,392
  • 8
  • 62
  • 102
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()

Gordon Freeman
  • 3,260
  • 1
  • 22
  • 42
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.

Brandon
  • 4,491
  • 6
  • 38
  • 59