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

blade84's avatar

"Session store not set on request." error when run artisan command

Hello ppl, Trying to create artisan command which run part of my code (there are third party API auth ) but when i run it a got error :

  Session store not set on request.```

Does anybody familiar with these error ?
Thx
0 likes
1 reply
rdelorier's avatar
Level 9

There is no session when running artisan command since its started by the "StartSession" HTTP middleware which doesn't run for console requests. If your just looking for a quick fix you can just request()->setLaravelSession(session()) and probably get it working :)

1 like

Please or to participate in this conversation.