public static function extension($check, $extensions = ['gif', 'jpeg', 'png', 'jpg'])
    {
        if ($check instanceof UploadedFileInterface) {
            return static::extension($check->getClientFilename(), $extensions);
        }
        if (is_array($check)) {
            $check = isset($check['name']) ? $check['name'] : array_shift($check);

            return static::extension($check, $extensions);
        }
        $extension = strtolower(pathinfo($check, PATHINFO_EXTENSION));
        foreach ($extensions as $value) {
            if ($extension === strtolower($value)) {
                return true;
            }
        }

        return false;
    }