prgrm prgrm - 4 years ago 106
PHP Question

Passing information between pages with Laravel

I need to pass information between pages.

I would usually just use sessions in plain PHP. I wonder if there is a more correct way to do this on Laravel.

First_page.php



<?php

session_start();

$_SESSION["ID"] = 'item_id';

?>


Second_page.php



<?php

session_start();


echo $_SESSION['ID'];
#"item_id"


?>


How is this supposed to be done in Laravel?

Answer Source

Just use Session.

Session::flash(); //or Session::put

Session::flash('values', $passvalues);     
Redirect::to('/add1');

$oldinput = Session::get('values');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download