Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

damms005's avatar

Why is Session::... not documented?

For all request objects, there is always the possibility to access session variables using $request->session()...

However, it is also possible to access same via Session::...

While the later is very much convenient, it is not documented anywhere. At least not in the official page https://laravel.com/docs/5.6/session

Why is this so? Is it that accessing session variables using this particular undocumented means is not safe futuristically?

0 likes
9 replies
Cronix's avatar
Cronix
Best Answer
Level 67

Really, probably only about 30-40% of laravel is documented in the main docs, for the most widely used functions. If you want the full documentation, look at the api docs. Look in the "Prologue" section on the top-left for "API Documentation" when on the main docs page.

Also, Laravel uses a lot of other components from Symfony and extends them. So you'd want to look in the Symfony docs for the full docs on those classes. Laravel will only document what they added/extended, but not the methods/functions of the base classes they extended.

2 likes
Snapey's avatar

During early days Taylor came under a lot of critisism for extensive use of facades. I wonder if this has caused Session:: to be downplayed in favour of the session() helper?

1 like
jlrdw's avatar

@Snapey I am using version 5.5 and the facade is still there available are you saying it's not in 5.6.

His facades are only to make them look a nice static call nothing more.

Really no documentation even necessary when technically they're not really a static call at all.

Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to almost all of Laravel's features. Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.

So facades in the documentation is the documentation for session colon colon also.

Cronix's avatar

No, he's saying that might be why it's not included in the regular documentation...

Snapey's avatar

No i'm not suggesting it has been or will be removed

Please or to participate in this conversation.