public function hasFlash($key = null)
    {
        $flashArray = Session::get('flashMessages');

        if (!is_null($key)) {
            if (isset($flashArray[$key])) {
                return $flashArray[$key];
            }
        }

        return false;
    }