I'm working with a complex object (RocketGate gateway) that can't be serialised.
I have a checkout made in 3 steps and spread hover 3 different Jobs. The ideally the object should be stored in the session and in each step. Actually I'm simply re-building the object at each step. It works but it has some problems that won't describe in details cause it's part of behaviour of this component.
Long story short: is there a way in Laravel to store somewhere a complex object without serialising it?
is there a way in Laravel to store somewhere a complex object without serialising it
Yes, in memory as PHP native object through all it's lifecycle. Do you really need to process asynchronously in several jobs? Can it all be handled in one sync job within one request?
Long story short: is there a way in Laravel to store somewhere a complex object without serialising it?
@thesimons How are you expecting Laravel to “store” your object if you don‘t serialise it in some form?
If you need an object across multiple jobs then a session is not the answer, as sessions are for HTTP requests; not CLI processes like queues. So, you’re either going to need to save this “object” to the database, disk, or cache.