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

acupofocode's avatar

Session, Javascript and blade

Hi developers, In my project I need save orders. There are lots of fields, I need if browser has been closed, info are saved for next time order will be opened. I'd like to use Laravel session + jquery: is jQuery an old tecnology to use? I've used Laravel in another project but this is the first time I need something like a "real time" saving data. Thanks in advance

0 likes
15 replies
bait-dept's avatar

While there are many new kids on the block, jQuery still holds relevance in the area.

I'd go with it and then change if necessary.

1 like
Sinnbeck's avatar

Yeah jquery is still widely used.

As for what I assume is a shopping basket. Just send ajax requests to laravel when the customer adds something to the basked, and let laravel handle all the session stuff

1 like
acupofocode's avatar

@Sinnbeck it isn't a basket.. is more like a B2C than a B2B. I've the problem I need update order changes frequently. Sizes, colurs, .. quantities..

Sinnbeck's avatar

@acupofocode I assume you just want to save a session with a list of product_ids paired with a count. For that the above answer sound be fine :) Just send product_id + count using ajax and update the session.

1 like
acupofocode's avatar

@Sinnbeck there's no only product_id and a count.. there are more fields .. customer address, delivery dates.. notes, payments, ..

Sinnbeck's avatar

@acupofocode But the user has no log in to remember that stuff? Sounds like a system where the customer would create an account if they want to have that stuff remembered from visit to visit.

Sinnbeck's avatar

@acupofocode Then you dont need session to save their information. Save it in a database instead. You can save all of it in a database.

1 like
Sinnbeck's avatar

@acupofocode I would say, give it a try. It is really great for alot of thing, but your knowledge will also be quite specific (jQuery is more generic).

1 like
Snapey's avatar

personally I would use livewire to keep the data on the server as each field is completed.

You could use local storage in the browser - it really depends on;

a) how comfortable you are with javascript b) if the users are likely to use a different device and expect to retrieve their partial order

1 like
acupofocode's avatar

@Snapey this project must be used on desktop and tablet. Not smartphone because of data quantities. I thought to laravel livewire.. I'm comfortable with javascript but I'm very confused with the amount of data must be handled..

Snapey's avatar

@acupofocode My point was, if you save to local storage then it is stored on the device, and can only be retrieved on that device, wheras if you store on the server then it can be retrieved by the user from any device.

1 like
acupofocode's avatar

@Snapey I need info saved and available everywhere in every moment, so I need they're saved on server I think

Please or to participate in this conversation.