1
Derzeit ich diese Sammlung haben:Laravel entfernen Artikel aus der Sammlung
return $items->map(function ($item) use ($location, $amount) {
if($item->is_active) {
return $this->calculate($item, array_values($location));
}
})
Wenn die if-Anweisung falsch ist ich das Element aus der Sammlung entfernt werden soll. Wie soll ich das machen?
bereits versucht:
return $items->map(function ($item, $itemKey) use ($location, $amount, $items) {
if($item->is_active) {
return $this->calculate($item, array_values($location));
}
$items->forget($itemKey);
})
Aber das funktioniert nicht?