rupeshpoonia / gmail-phn-validation

这是 gmail-phn-validation

v1.0.0 2023-06-25 16:14 UTC

This package is not auto-updated.

Last update: 2024-10-01 07:38:00 UTC


README

# Gmail & Phone Number Validation Package

This package provides functionality for validating Gmail addresses and Indian phone numbers using the libphonenumber-for-php library and the Illuminate validation component.

## Features

- Email validation: Validates if an email address is in a valid format according to the FILTER_VALIDATE_EMAIL filter.
- Phone number validation: Validates if a phone number is a valid Indian number by utilizing the libphonenumber-for-php library.

## Requirements

- PHP 7.4 or higher
- giggsey/libphonenumber-for-php library
- illuminate/validation component

## Installation

You can install this package using Composer. Run the following command:

```bash
composer require rupeshpoonia/gmail-phn-validation

使用方法

邮箱验证

要验证邮箱地址,请使用 ValidEmail

use rupeshpoonia\ValidEmail;

$email = 'test@example.com';
if (ValidEmail::validate('email', $email)) {
    echo 'Valid email address.';
} else {
    echo 'Invalid email address.';
} 

电话号码验证

要验证电话号码,请使用 ValidPhoneNumber

use rupeshpoonia\ValidPhoneNumber;

$phoneNumber = '+911234567890';
if (ValidPhoneNumber::validate('phone', $phoneNumber)) {
    echo 'Valid phone number.';
} else {
    echo 'Invalid phone number.';
}

贡献

欢迎贡献!如果您发现任何问题或有改进建议,请打开一个问题或提交一个拉取请求。

许可证

此软件包是开源的,可在MIT许可证下使用。有关更多信息,请参阅LICENSE文件。


You can customize and modify this README file to provide additional details or instructions specific to your package. Include information about installation, usage examples, contributing guidelines, and license details.

Remember to include any necessary links, such as the repository link, license file, and relevant documentation.

Feel free to adjust the README file as needed to accurately represent your package and provide useful information to potential users and contributors.

Let me know if you need further assistance or have any other questions!