Getting Started
Introduction
Turn PDFs, Word docs, spreadsheets, and more into clean Markdown, built for Laravel.
use ParseForArtisans\Facades\Parse;
$parse = Parse::file('contract.pdf')->for($document)->parse();
$parse->status(); // 'pending', 'completed'
The result arrives via a Laravel event when it's ready. ->for($model) ties the job to one of
your records, so the event hands that record straight back, with no ids to track. The SDK
publishes a listener that you can customize
// app/Listeners/HandleParsedDocument.php:
use ParseForArtisans\Events\ParseCompleted;
class HandleParsedDocument
{
// This event fires when parsing is finished
public function handle(ParseCompleted $event): void
{
$document = $event->request->parsable; // the model you passed to ->for()
$document->update(['markdown' => $event->request->markdown()]);
// ...store it, index it, send it to an LLM
}
}
How it works
->parse()hands us the job and returns aParseRequesthandle right away.- We parse the document and write the Markdown straight to your bucket (or our managed dev bucket if you haven't set one up).
- We ping a webhook and you get a
ParseCompletedLaravel event. The Markdown is already ready.
Our SDK handles webhooks, secrets, presigned URLs.
For local development, if you're running a queue (
composer devworks) it will just work. No need to set up webhook endpoints etc.
What it supports
You call ->parse() on the file; we detect the type and route it for you, with nothing to
configure per format:
- PDF (with automatic OCR for scanned files)
- Word (
.docx,.doc) - PowerPoint (
.pptx,.ppt) - Spreadsheet (
.xlsx,.xls,.csv) - Email (
.eml,.msg)
See Supported formats for the full list, what each produces, and the parsing features (multi-column layouts, tables, frontmatter, page ranges, and more).