How we ported our packages to Go after the surprise Laravel Go release
Yesterday, Laravel Go dropped by surprise. We'd only just announced our Rust packages, and now there was another version of Laravel we wanted to support.
We've now ported 44 of our PHP packages to Go. That includes packages for Laravel Go, such as Media Library and Permission, and framework-agnostic tools you can use without Laravel. You can browse them all on our Go packages page.
It went much faster this time. The work we'd done on the Rust packages had given us a way of doing this that we could use again.
The second time was quicker
We used AI to build our Rust packages. Along the way, we worked out how to give the agent the context it needed and what we wanted a finished package to look like.
There's quite a bit around the code that needs attention too. A package needs a useful README and documentation that explains how to install and use it. It needs to follow our conventions and have a place on our website. During the Rust work, we'd already figured out how to handle that polish.
When Laravel Go arrived, we could reuse that process. We still had to adapt the packages to Go and Laravel Go, but we didn't have to work out the whole approach again. The agent had our existing packages to work from, and we already knew how to guide it through the work around them.
That's what made this round quicker. The Rust work had given us more than Rust packages. It had also taught us how to do the next port.
Years of work behind a new port
We're not Go experts yet. Getting these ports out quickly doesn't give them the track record of our PHP packages, and I'd welcome feedback from people who know Go better than we do.
But the starting point matters. Our PHP packages have years of polish in their code and documentation. We've used them in our own projects, changed APIs that were awkward, and added ways to customize behavior when the defaults didn't fit. People using the packages have helped us find edge cases we wouldn't have thought of ourselves.
That gave the agent much more to work with than a description of a feature. It could work from existing implementations, tests, and documentation that explain how the packages behave. We know why those packages work the way they do, even when we're still learning how best to express that in Go.
As I wrote in the Rust announcement, a lot of the work goes back to decisions we'd already made in PHP. We don't need to redesign what a permission package should do for every language. We do need to make sure the Go version fits Go, and that's something we'll keep improving.
Our PHP and Rust packages remain supported too. This is another set of packages you can choose from, not a reason to move an existing application.
An early release
All 44 packages have tagged releases in the 0.1 series. We've already released patches for several of them. Check each package's installation instructions and releases for the current version.
These are early releases, not stable ones. I'd try them in a side project first, and expect APIs and implementations to change as we learn more. If you spot a bug, an unclear bit of documentation, or a better way to write the Go code, please open an issue or a pull request.
Our Laravel Go packages
We've released 26 packages for Laravel Go. Each link below takes you to that package's documentation.
- Activitylog records activity in your Laravel Go application.
- Analytics retrieves Google Analytics data.
- Backup backs up application files and databases, cleans up old backups, and monitors backup health.
- CSP sets Content Security Policy headers in your application.
- Feed generates RSS, Atom, and JSON feeds.
- Health monitors the health of your application.
- Honeypot helps prevent spam submitted through forms.
- Mailcoach Mailer sends transactional mail through Mailcoach.
- Mailcoach SDK lets you work with the Mailcoach API from Go and Laravel Go.
- Markdown renders Markdown with options to customize the output.
- Media Library associates files and image conversions with your application models.
- Missing Page Redirector redirects missing pages in your application.
- OG Image generates Open Graph images.
- PDF generates PDFs in your application.
- Permission associates users with roles and permissions.
- Query Builder builds model queries from API requests.
- Response Cache caches HTTP responses.
- Schedule Monitor monitors scheduled tasks.
- Site Search builds a full-text search index by crawling your site.
- Sitemap generates sitemaps for your site.
- Stripe Webhooks handles Stripe webhooks in your application.
- Suspicious Login detects suspicious logins using customizable security checks.
- Tags adds tags and taggable behavior to your models.
- Translatable stores model translations in JSON columns.
- Webhook Client receives webhooks in your application.
- Webhook Server sends webhooks from your application.
Our framework-agnostic Go packages
These 18 packages can be used without Laravel.
- Browsershot converts a web page to an image or PDF using headless Chrome.
- Calendar Links generates add-to-calendar links for Google, Yahoo, Outlook, and iCal.
- Crawler crawls the links on a website.
- DB Dumper creates dumps of MySQL, MariaDB, PostgreSQL, SQLite, and MongoDB databases.
- Holidays calculates public holidays for a country.
- Image manipulates images through an expressive API.
- Image Optimizer runs images through optimization tools.
- Lighthouse runs Google Lighthouse from Go.
- Opening Hours queries and formats opening hours.
- PDF to Text extracts text from PDFs using Poppler or Xpdf.
- Period compares date ranges.
- Ray sends debug output to the Ray desktop app.
- Robots.txt parses robots.txt, robots meta tags, and X-Robots-Tag headers.
- Schema.org builds Schema.org types and JSON-LD.
- Simple Excel reads and writes Excel and CSV files.
- SSL Certificate queries and validates SSL certificates.
- Temporary Directory creates temporary directories and removes them when you're done.
- URL Signer creates signed URLs with a limited lifetime.
In closing
You can find the documentation and GitHub repositories for all 44 Go packages on our site. Our Rust announcement has more on the work that made this round of ports possible.
I didn't expect to be writing another package announcement quite so soon. I'm glad the work we put into the Rust packages helped us get here faster, and I'm curious to hear how you get on with the Go versions.