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

V9द's avatar
Level 3

Use session in routes file laravel 5.2

Hello All,

Want to know that, How to use laravel session in route file ?

0 likes
2 replies
jlrdw's avatar

You should never have a need to use session in a route, rather, use in blade view and pass a variable if needed.

Furthermore, the session variable will be available in the controller.

But session is available anywhere, you may just need to put the use statement.

V9द's avatar
Level 3

@jlrdw Thanks for reply, I need to use session in routes files, I'm including different different routes files on the basis of user type.

Please or to participate in this conversation.