Tutorials
Practical step-by-step guides on Laravel, Filament, and the PHP ecosystem.
The internet treats the Laravel AI SDK and Prism PHP as competitors and keeps repeating that the official SDK uses Prism under the hood. The composer.json says otherwise. In this post: what each package actually does, the code side by side, the table of what only exists in one of them, the release cadence of both, and a decision guide by concrete case. No "it depends".
The Laravel AI SDK is Laravel's first-party AI package: agents as PHP classes, tool calling, structured output, streaming, embeddings with pgvector and fakes for testing without burning tokens. A practical guide from composer require to your first running agent, covering what the SDK solves, what it doesn't, and the limitations nobody tells you about.
You send a one-line question and /usage reports a whole day's worth of consumption. Saving tokens in a coding assistant has nothing to do with prompt size: it's about prefix caching. How it works in Claude Code, Codex, and Cursor, the seven actions that invalidate it without you noticing, how to measure it with cache_read vs cache_creation, and eight levers to stretch the session.