RomeNYRR
RomeNYRR

Reputation: 887

Laravel 5 | Session Flash For Form

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 (submit button) 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 to give me some insight, 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;

    }

Update:

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

Upvotes: 1

Views: 912

Answers (2)

RomeNYRR
RomeNYRR

Reputation: 887

For some reason the session->Flash() method wasn't working, so i switched both over to session::put('quote', $request->all()); & Session::pull('quote');

Upvotes: 0

Dallin
Dallin

Reputation: 1074

You're returning a view before you try and get data from the session in your controller. session()->flash() should only last for one request. Try using session()->put() instead

Upvotes: 1

Related Questions