Laravel Sift
Tell a business email from a Gmail address.
composer require mischasigtermans/laravel-sift
An email address tells you who someone works for, unless it ends in gmail.com. Sift draws that line. It pulls the domain out of an address, drops it when it belongs to a public provider, and hands you what's left: the company.
That matters in a few dull, important places. A lead form that should only take work addresses. Grouping users by company. Matching sign-ups to accounts in a CRM. Knowing how many of your users signed up with a business email at all. Stagent uses it in production.
It's a list, not a lookup. Sift doesn't check that a domain exists, that it receives mail, or that the company is real. A domain counts as business when it isn't on the list, so a provider that's missing passes as a business until you add it with additional_domains.
What it does
-
A domain, or null
Sift::domain('user@company.com') returns company.com. A Gmail, Yahoo or Outlook address returns null, unless you ask for public domains too.
-
A business-email rule
Sift::rule(), or new BusinessEmail, in a form request rejects personal addresses with 'The email must be a business email address.'
-
Batches and stats
Sift::domains() returns the unique business domains in a list of emails. Sift::stats() gives the total, the business and personal split, the business rate and the top domains.
-
A provider list kept current for you
The list of public-provider domains lives in the package, so an update brings new ones. Add your own with additional_domains, or let one through with exclude_default_domains.
Hi, I'm Mischa. I've been shipping products and building ventures for over a decade. First exit at 25, second at 30. Now Partner & CPO at Ryde Ventures, an AI venture studio in Amsterdam. Currently shipping Stagent, TAP and Steddle. I write about what I learn along the way. More about me.
You might also enjoy: Every setting in my Claude Code config, explained.