Adding a blog to a Laravel app usually means one of two things: a full CMS you didn't want, or a posts table and a lot of hand-written SEO plumbing. Neither tells you whether a post is any good before it goes out, and neither is ready for the way more and more teams now write — with an AI assistant in the loop.
Laravel AI Blog is our answer: a free, open-source blog package for Laravel 10 to 13, released under the MIT license, with no paid tier.
composer require byteminus/laravel-ai-blog
php artisan vendor:publish --tag=laravel-ai-blog-migrations
php artisan migrate
The code is on GitHub and the package on Packagist.
Headless by default
Laravel AI Blog gives you models, migrations and a trait — not an admin panel you have to work around. Already have a Post model? Keep it:
use ByteMinus\AiBlog\Concerns\HasBlogSeo;
class Post extends Model
{
use HasBlogSeo;
// Override only what differs from the defaults
public function getBodyField(): string { return 'content'; }
}
Point ai-blog.models.post at your model and you're done. When you want public pages, one config flag turns on /blog, post, category and tag routes, an RSS feed, and Blade components for meta tags, structured data and the post body.
An SEO score with fixes you can act on
Every post gets a deterministic on-page score — no API key required:
$report = $post->seoReport();
$report->score; // 72
$report->grade(); // "B"
$report->fixes(); // ["Include \"laravel queues\" in the title.", "Add at least two links — ..."]
The fixes are written in plain English, so a writer knows exactly what to change. Alongside the score:
- Internal links —
$post->suggestedLinks()proposes related published posts with anchor text. - Stale-post detection —
php artisan ai-blog:audit --stalelists posts due for a refresh. - Structured data —
BlogPostingJSON-LD on every post, andFAQPagewhen a post has a## Question?heading followed by its answer. - The search-engine basics — canonical URLs, Open Graph and Twitter cards, publish and modified times, paginated index pages with distinct titles, and an RSS 2.0 feed.
php artisan ai-blog:audit scores every post and lists its fixes and link suggestions in one go.
AI as your editor, not your ghostwriter
The AI features are optional. Install the official laravel/ai SDK, use any provider it supports, and you can:
// Keyword → brief → full draft, saved as a DRAFT for a human to review.
$draft = AiBlog::draftFromKeyword('laravel queues');
// Fill in a missing target keyword and meta description.
AiBlog::enrichSeo($post);
There are also rewrites, refresh suggestions and translations. Every one of them produces a draft. The package marks unverified claims as [verify: ...] and records how much AI was involved in each post, because AI that writes thirty posts a month from a keyword list is exactly what search engines are built to bury. Auto-publishing exists as a config flag you turn on knowingly — never as a default.
Let agents write your blog — safely
Laravel AI Blog includes a laravel/mcp server. Enable it in the config, protect it with your usual middleware, and connect Claude Code or any MCP client:
claude mcp add --transport http my-blog https://example.com/mcp/ai-blog --header "Authorization: Bearer <token>"
Agents get list_posts, get_post, create_draft, update_post, draft_from_keyword, score_post, suggest_links and schedule_post. There is deliberately no publish_post tool: agents draft, score, link and schedule, and a human — or the scheduler, after a human scheduled it — publishes. For Claude.ai and ChatGPT custom connectors, laravel/mcp's OAuth support works with Passport.
Built to be safe around untrusted content
Two pieces do the unglamorous work that keeps an AI-connected blog safe:
SafeFetcherreads public pages and feeds so the AI has real sources. It runs only from queued jobs or Artisan commands, rejects internal hosts and non-standard ports, pins each connection to the address it checked so DNS rebinding can't redirect it, obeysrobots.txt, and caps size and time. Everything it returns is treated as untrusted text before it goes near a model.- The command bus sends every change — from a dashboard, an Artisan command, a job or an agent — through the same rules: the actor must hold the command's ability, every request carries an idempotency key so retries can't run twice, and each outcome is written to an audit trail.
What's next
The roadmap includes a built-in XML sitemap, semantic linking with embeddings, topic clusters and content gaps from your existing posts, Filament and Nova adapters, multilingual posts with hreflang, and scheduled drafting pipelines. Most items have a good first issue in the repository.
Get started
- Install:
composer require byteminus/laravel-ai-blog(Packagist) - Source, issues and contributing guide: github.com/byteminus/laravel-ai-blog
- Requirements: PHP 8.2 to 8.5 with
curl,dom,libxmlandmbstring; Laravel 10, 11, 12 or 13
Security issues should be reported privately, as described in the repository's SECURITY.md.