I came to a conclusion that I should be using a session storage to store singleton class within a session. Because as per my understanding PHP is stateless, and every time new request comes to laravel, it must be creating and instantiating a new instance of singleton class every time for a new request and then after serving the response everything dies down I guess.
May 17, 2017
1
Level 7
One singleton service class per user session
I have a need to use unique instances of singleton service class (for which I have my own custom service provider) per user session?
May be I am missing something here but anyone has any ideas about what design patterns or solution approach I can use for this ?
Please or to participate in this conversation.