Level 6
I think it would be
Session::forget('booking.vehicle_availability');
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all,
So I have added some data to my session via
$array = ['vehicle_availability' => ['costs' => $costs]];
Session::push('booking', $array)
If further down the line I wanted to 'remove' the 'vehicle_availablity array from the session how would I go about this?
Using the PHP global $_SESSION I believe the way to have done it would be:
unset($_SESSION['booking']['vehicle_availability']);
Just unsure of the 'laravel way'
I think it would be
Session::forget('booking.vehicle_availability');
Please or to participate in this conversation.