I create a session in my controller like this:
Session::put('myoffer', $book->id);
In my other controller, I save data to a table and it looks like this:
public function store(Request $request)
{
//
$data = [
'user_id' => Auth::id(),
'book_id' => $request->book_id,
'offer_price' => $request->offer_price,
'offer_message' => $request->offer_message
];
Book::Create($data);
return redirect()->route('buyer.dashboard');
}
How can I delete the session after the data is saved in the offer table?