set( $type, array_merge(session()->get($type, []), [$value]) ); } /** * @return array */ protected function getNotifications(): array { $return = []; foreach (['errors', 'warnings', 'information', 'messages'] as $type) { $return[$type] = Collection::make(Arr::flatten(session()->get($type, []))); session()->remove($type); } return $return; } }