Download the PHP package imliam/php-unique-gmail-address without Composer

On this page you can find all versions of the php package imliam/php-unique-gmail-address. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-unique-gmail-address

Unique Gmail Address

Latest Version on Packagist GitHub Tests Action Status Total Downloads

A package to ensure that a Gmail address is unique.

The Gmail platform offers some features that other email platforms don't. There can be an infinite number of different Gmail addresses that point to a single Gmail inbox/account, which can make it very easy for malicious users to abuse with no effort.

To learn more about how a user can make a infinite addresses for one Gmail inbox, check out this article.

This package makes it possible to detect duplicate addresses for one Gmail account and to ensure they're unique.

Installation

You can install the package via composer:

Usage

The primary usage of this package revolves around the supplied UniqueGmailAddress class, which can be passed an email address to compare:

The isGmailAddress method will check if the given address belongs to a Gmail account:

The normalizeAddress method will take an email address and normalize it to the simplest variation:

⚠️ It's best to save and use the email address exactly as the user gave instead of only saving a normalized version. If a user enters a denormalized email address, they probably expect any emails they receive to be at that exact address and not the normalized version.

The getRegex and getRegexWithDelimeters methods will return a regular expression that can be used to compare the original email address to another one, using a function like preg_match:

The matches method will immediately match the regular expression against another value, returning true if both email addresses belong to the same Gmail account:

Laravel Rule

One of the most common use cases for wanting to check duplicate Gmail accounts is to prevent multiple users signing up to your service with the same email address.

To handle this case, the package also provides a Laravel validation rule class that can be used to check the database if a matching email address is already present.

By default, it will check the email column in the users table, but these can be overriden if needed when using the rule:

This rule assumes that you are storing denormalized email addresses in the database. This rule will use a regex match against every row in the database to check if

💡 If you don't want to use a regex match against every row of the database, you could instead store the normalized email address in a second column alongside the original email address, for example in a normalized_email column.

This would allow you use the regular exists rule to do a direct match against, much more efficiently.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of php-unique-gmail-address with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package imliam/php-unique-gmail-address contains the following files

Loading the files please wait ....