Hi guys!
I’ve just released v1.0.0 of a small package that I’ve been working on. It’s a wrapper package that can be used for validating email addresses using the Mailbox Layer API.

It includes caching which can be used to significantly speed up the validation process and reduce the chance of hitting those pesky API limits.
As usual, I love getting feedback from you all. So, any advice, feedback, or contributions are greatly appreciated!
Anyone interested in checking out the package, here’s the link: https://github.com/ash-jc-allen/laravel-mailboxlayer
Hopefully it comes in handy for some of you.
Merry Christmas!
This isn’t so much for this application as much as Mailbox Layer API but why would I need this? What are the chances that Mailbox Layer says it is not a valid email when both the owner of the email and FILTER_VALIDATE_EMAIL says it is valid?
As far as your code, it looks really nice and simple. I would like to see a more class and namespace way of loading the mailbox api key.
https://github.com/ash-jc-allen/laravel-mailboxlayer/blob/master/src/Providers/MailboxLayerProvider.php
Does it have to load the config file like that?
I suppose there’s different reasons that people might use this. But for me personally, I’m working on a project where we need to import data (more or less user data with contact details) into a system from other third party systems and make sure that it’s 100% accurate.
As an example, say one of these users has an email address ‘[email protected]‘. But let’s say that the address has been deleted because it’s for an old employee that hasn’t been purged for any random reason. That email has a valid structure and would get through most email validation that PHP provides (as far as I’m aware). So it would usually get through our validation. But with Mailbox Layer, it would be able to validate whether that address is still in use and if we can send emails to it.
You’re right, that 9/10, using plain old PHP would probably catch most errors. Especially the ones related to the email structure. This is more for double checking really and making sure no outdated or spoof data slips through.
It can also be useful as well for if you want to detect disposable email addresses that are being used (mailinator, etc…)
Hopefully that makes sense?

Sorry I completely forgot to mention the API key side of things as well in my other comment.
Thanks for the feedback!
The binding that you see in that provider is just for getting the facade ready for using. I did consider adding another method that you could use for setting the key, but wasn’t too sure which direction to take it in. So I just opted for doing it this way.
If you were to create the MailboxLayer object yourself, you’d be able to pass the key into the constructor as the only argument to set it normally.
Whats your opinion on this though? I’d love to hear other people’s approaches to this kind of thing, it helps me to learn a bit more
Members
Online

source