- What does imliam/php-unique-gmail-address actually do?
- It is a small, framework-agnostic PHP utility for working with Gmail address variants. It generates plus-tag aliases from an existing Gmail account so addresses look different while still delivering to the same inbox. It is useful for testing, signups, and avoiding duplicate-email checks, but it is not a full identity or verification package.
- How do I install imliam/php-unique-gmail-address in a Laravel project?
- Install it with Composer using composer require imliam/php-unique-gmail-address. Because it is framework-agnostic, you normally call it from a small Laravel service, action, or custom validation rule rather than expecting Laravel-specific integration. Keep the package namespace isolated behind your own adapter so you can swap it later.
- Which PHP and Laravel versions does this package support?
- The README excerpt provided does not list version constraints, so check the package composer.json for its PHP requirement and any Illuminate dependencies before installing. Since the utility is framework-agnostic, Laravel compatibility is mostly a matter of running it on a supported PHP version. Test it in your application's actual Laravel version rather than assuming support from the package name alone.
- Does this package enforce Gmail address uniqueness in the database?
- No, it should not be treated as a database uniqueness layer. It generates Gmail alias variants, and the TPM assessment notes it may only normalize rather than check uniqueness. Enforce uniqueness with a unique database index on a canonical Gmail key, and use the package only to derive that key or generate aliases.
- Does imliam/php-unique-gmail-address handle googlemail.com addresses?
- Gmail treats gmail.com and googlemail.com as the same mailbox, so your application must handle both consistently. The provided README excerpt does not confirm the package's behavior for googlemail.com, so verify it with a test before relying on it. If it does not normalize googlemail.com, wrap that logic in your own GmailAddressNormalizer service.
- Does it strip dots and plus tags from Gmail addresses?
- The package's stated purpose is adding plus-tag aliases, not necessarily stripping all Gmail-specific variations. Gmail ignores dots in the local part and treats plus tags as aliases, so a canonical key should account for casing, dots, and plus tags consistently. Confirm the exact behavior with tests covering [email protected], [email protected], and mixed-case variants.
- How should I store Gmail addresses in Laravel to prevent duplicate accounts?
- Store the user's original email for delivery and display, and add a separate nullable canonical_gmail_address column or identity-key table. Backfill historical users, resolve duplicates, then add a unique index on the canonical value. Registration and profile updates should write both values transactionally, and the database constraint should enforce uniqueness to avoid race conditions.
- Can I use this package for non-Gmail email addresses?
- You should not apply Gmail-specific normalization universally. Other domains may treat dots, plus tags, and casing differently, so running Gmail rules on them can create false duplicate matches. Guard the logic by domain and only use the package when the address is gmail.com or googlemail.com, leaving other addresses unchanged.
- How do I test Gmail address uniqueness and normalization in Laravel?
- Write adapter-level tests for plus tags, dots, casing, googlemail.com, non-Gmail addresses, and duplicate insert attempts. Use PHPUnit or Pest with database tests that assert the unique index rejects a second canonical key. Lock in expected normalization behavior so a package upgrade cannot silently change identity matching.
- Is imliam/php-unique-gmail-address safe and maintained enough for production?
- It is a small utility with modest adoption and a single-maintainer orientation, so treat it as one component rather than your whole uniqueness strategy. Pin the version, wrap it behind your own service, and cover Gmail edge cases with internal tests. Have a support playbook for duplicate-account conflicts during backfill and rollout, and monitor maintainer activity before major upgrades.