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

BastianSchur's avatar

Session:: vs $session - Different Content

Hi everyone,

i have a problem on my multi tenant system.

I have to access the session from different places. If i nedd the session in the controller i use the method injection by laravel to get an instance from session. But if i access this from a helper function i have to use the session facade!

Now i found out, that this are different sessions - Whats here up?

Greetings

0 likes
2 replies
BastianSchur's avatar

I get a different content from these commands:

$session->all(); ( Session instance from Controller ) Session::all(); ( Use the facade )

Please or to participate in this conversation.