May 17, 2017
0
Level 5
Storing Model Object in Session
I'm building an EPOS system and need to store the basket model object in the session, so that while the transaction is still open I can add products to the basket, compute some stuff and then when the transaction is finished, serialize and save it to the database.
I'm putting the basket model object in the session via session()->put('basket', $basket) but that only stores the accessible values, and not any of its methods.
Is there a way to persist model objects with their methods across multiple requests until ready to save them to storage?
Please or to participate in this conversation.