从Laravel会话中的数组中删除项目

How can I delete only a single item from an array in Laravel with Sessions. When I try to do it now with Session:pull, it just deletes the whole session object with key estate.id and with all the items in the array. I want to match only the object that has the same id as the id received from the input.

Simplified code

$estateId = Input::get('id', null);

if ($processType == "add") {
    Session::push('estate.id', $estateId);
   }
else {
  if (in_array($estateId, $data)) {
     $value = Session::pull('estate.id', $estateId);
  }
}

The Laravel Session service doesn't offer a built in method to remove a value from an array, but there is a workaround you can do with:

Session::put('key', array_diff(Session::get('key'), ['value']));