public function clear($params = [])
    {
        if (isset($params['level']) || isset($params['content'])) {
            $level = isset($params['level']) ? $params['level'] : '';
            $content = isset($params['content']) ? $params['content'] : '';
            $area = isset($params['area']) ? $params['area'] : '';
            $messages = $area ? (array)Session::get($this->id . '.' . $area) : (array)Session::get($this->id);

            $adjust = function ($messages) use ($content, $level) {
                $new = [];

                foreach ($messages as $message) {
                    if ($content && $level && $message['content'] != $content && $message['level'] != $level) {
                        $new[] = $message;
                    } else {
                        if ($content && !$level && $message['content'] != $content) {
                            $new[] = $message;
                        } else {
                            if (!$content && $level && $message['level'] != $level) {
                                $new[] = $message;
                            }
                        }
                    }
                }

                return $new;
            };

            if ($area) {
                Session::set($this->id . '.' . $area, $adjust($messages));
            } else {
                foreach ($messages as $area => $areaMessages) {
                    Session::set($this->id . '.' . $area, $adjust($areaMessages));
                }
            }
        } else {
            if (isset($params['area'])) {
                Session::clear($this->id . '.' . $params['area']);
            }
        }

        return $this;
    }