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

Walker's avatar

Push into the session more data

Hi I need advice. I save the data from the form to the session as formData and I would need to fill in the form again so that this data can also be pushed into the session so that I can access it.

this is how I store data in a session $request->session()->put('formData', $request->all());

This is how I approach them

public function index()
    {
        $product = Product::get();

        $data = session('formData');

        return view('cart.index', [
            'product' => $product,
            'data' => $data
        ]);
    }
0 likes
1 reply

Please or to participate in this conversation.