public function map(callable $callback) { $keys = array_keys($this->items); $items = array_map($callback, $this->items, $keys); return new static(array_combine($keys, $items)); }
/** * Reflash message to next session. * * @return void */ public function again() { $this->next = $this->current->map(function ($item) { return $item->toArray(); })->merge($this->next)->toArray(); $this->session->keep([$this->key]); }