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

oborrero's avatar

Laravel 5 | Session Flash for Form

Greetings,

I just finished setting up a form that takes some data and does a quick validation to confirm everything selected. On the confirm page, there's an action method that calls the controller to store the data. The problem is, when I click submit the next page is just blank. I have debugbar enabled but nothing pops up at all, it's just a blank page.

Do I have to use a different flash call?

Heres my 'QuoteRequestController.php'

 public function confirm(Requests\PrepareQuoteRequest $request, Guard $auth)
     {
        $quotetemplate = $this->compileQuoteRequestTemplate($data = $request->all(), $auth);

        session()->flash('quote', $data);

        return view('quotes.confirm', compact('quotetemplate'));

        $request->get('$datacenters');


    }

public function store ()
 {

    $data = session()->get('quote');

    return $data;

    }
0 likes
5 replies
dertechniker's avatar

Actually flash should work. Ever tried to use $session(['quote' => $data])? Just to try it out...

oborrero's avatar

Hi Dertechniker, completely new to programming and laravel so forgive my noobishness. Where would i call that variable, in the confirm or store method?

bobbybouwmann's avatar

Do you post to the correct route? It sounds to me that you don't call the correct function

oborrero's avatar

I just double checked, I'm usting the restful resource route controller, so quoterequest.store is in there

oborrero's avatar

After doing some recon it seems that this White Screen of Death is probably because of a "return" issue. Playing around with redirect to see what happens - I've checked app/logs, nginx logs, chmod app/logs directory, used DD($data) and it returned null - but still can't figure this thing out. When I enabled authentication for a test signup form and I'm logged in and can hit all the pages. When I do a php artisan route:list it doesn't show the middleware auth attached to the resource routes. Could that be part of the issue?

Please or to participate in this conversation.