I am trying to store booking details with the help of a session variable. In the first function:
public function hold(Request $request){
$details = [
'times' => $arr,
'subTotal' => $subTotal,
'tax' => $tax
];
$request->session()->forget('cart');
$request->session()->put('cart',$details);
}
Next, it will be posted to another function of same controller. Upto this point session is available.
public function checkout(){
dd(session()->all());
}
Next route is on payment controller. This is another controller than the previous one. Here, the session variable is empty.
public function createPayment(){
dd(session()->all());
}
What am I doing wrong? How can I access session in this createPayment function?