In a previous tip, I asked "What if every Composer package had a fee?". One common situation where we might consider bringing in a new package is to communicate with a third-party API. Whether the API provider publishes the package, or it's written by someone in the PHP community, the idea is it could save us time when building out the integration.
On a recent project, we had to integrate with a large CRM platform, and the provider had published a PHP package for working with their API. After looking at the package, though, it didn't seem to be well-maintained, and the code quality was a little questionable.
On top of that, we only really needed to use three API endpoints, so it felt like overkill to bring in a whole SDK. Instead, we decided to write our own class that made a few
Http client calls. It was a little more work, but it was well-tested, and contained only what we needed.
Here to help,
P.S. You think this tip is good? You should try our free book of even more Laravel tips to make your application a little bit better.