← Blog

·

I parsed tens of thousands of legal documents. Then I built the tool I wanted.

Late last year I was running a legal startup, Sputnik Legal. The product doesn't matter for this story. What matters is what arrived in our inboxes every day: documents. Tens of thousands of them.

If you've never worked with lawyers, you might imagine contracts as tidy PDFs. Some are. The rest is whatever software the client happened to have that day. Emails scanned into PDFs. Word documents from versions of Word that no longer exist. Spreadsheets doing the job of databases. Faxes that became scans that became attachments. The winner was a Colombian invoice: a PDF packaged inside a different format entirely, wrapped and digitally signed by the government. A document inside a document, notarized. Whatever a client sends a lawyer, the lawyer sends to you, and now it's your problem.

Our pipeline needed text. Clean text, because we were feeding it to language models, and garbage in really does mean garbage out.

The open source round

I build in Laravel and I have since version 4, so I started where most PHP developers start. smalot/pdfparser is a solid library, and spatie/pdf-to-text is a nice wrapper around pdftotext. For a digital PDF with a proper text layer, they're fine, and they're free.

But a scanned document has no text layer, so those libraries return an empty string. You need OCR. And OCR meant running Tesseract, which meant babysitting a binary and its language packs on every environment, and the output on multi-column legal documents still came back as word soup. The legacy .doc files and the email formats each needed their own tool on top. I didn't want a parsing pipeline made of seven packages and a shell dependency. I wanted the text.

The LlamaParse round

So we did the sensible thing and paid someone. We picked LlamaParse, and I want to be fair here: it's a good product. It handled the scans, it handled the weird formats, the Markdown came out clean.

Then the volume grew, and the bill grew with it. For our heavier customers, the parsing bill alone was heading toward thousands of dollars per month. Per customer. When a cost scales with each customer you sign, it isn't a line item anymore, it's part of your margin. And we were spending it on turning documents into text, which is the plumbing of a document-heavy app, not the product.

We eventually shut the startup down, for reasons that had nothing to do with parsing. But that bill stayed with me.

The tool I actually wanted

When I looked around afterwards, the gap was still there. What I wanted was specific:

A composer package, because I'm a Laravel developer and I didn't want to hand-roll HTTP calls and webhooks for the fifth time. Pricing that survives volume, so the bill doesn't grow with every customer you sign. And better output than the open source stack on the ugly 20 percent: scans, legacy formats, multi-column layouts.

Nobody was building that for Laravel. The parsing companies were all moving upmarket, chasing enterprise contracts. The Laravel packages all handled the easy formats and stopped there. So I built it.

It's called Parse for Artisans, and using it looks like this:

use ParseForArtisans\Facades\Parse;

Parse::disk('s3')->file('contracts/foo.pdf')->for($document)->parse();

The Markdown lands back in your bucket and a ParseCompleted event fires with your model attached. Scanned PDFs get OCR automatically. The formats I used to dread, .doc from 2003, .msg exports, PowerPoint, all go through the same three lines. And it costs about a dollar per thousand pages (as of July 2026), with 15,000 pages a month free, because the whole point was pricing I would have been happy to pay back when it was my bill.

I'm building it in public and the Laravel AI ecosystem is finally taking off, with the official AI SDK shipping in Laravel 13. Every RAG tutorial starts with "first, get your documents into text." That step is what burned me. Now it's three lines.

If you're parsing documents in Laravel, whether with my tool or anything else, I'd honestly love to hear what formats you're fighting. I collect horror stories now. peter@helpfulintelligence.co

Parse for Artisans is a document parsing API for Laravel that converts PDF, DOCX, scans, and 20+ formats to clean Markdown.