relaticle/ink
Filament-native content publishing for Laravel: Eloquent models, full admin for posts/categories, SEO + JSON-LD, RSS, search, Blade UI components, and 13 MCP tools for AI agents. Headless by default with optional public blog routes.
::alert{type="info"} Want a working blog without writing controllers? See Public-routes mode — flip a config flag and you're done. This page covers the headless mode for hosts who want full control. ::
In headless mode the package ships no routes, no controllers, no page views. You wire your own routing and use the provided Blade components.
use App\Http\Controllers\BlogController;
Route::prefix('ink')->name('blog.')->group(function () {
Route::get('/', [BlogController::class, 'index'])->name('index');
Route::get('/feed', [BlogController::class, 'feed'])->name('feed');
Route::get('/category/{slug}', [BlogController::class, 'category'])->name('category');
Route::get('/tag/{slug}', [BlogController::class, 'tag'])->name('tag');
Route::get('/preview/{post}', [BlogController::class, 'preview'])
->name('preview')->middleware('signed');
Route::get('/{slug}', [BlogController::class, 'show'])->name('show');
});
The route names matter — the package's URL helpers and SEO components check for them via Route::has(...) and fall back gracefully when missing.
use Relaticle\Ink\Models\Category;
use Relaticle\Ink\Models\Post;
use Relaticle\Ink\Models\Tag;
final readonly class BlogController
{
public function index(): View
{
$posts = Post::query()
->published()
->with(['category', 'author', 'seo'])
->latest('published_at')
->paginate(config('ink.per_page', 12));
return view('blog.index', compact('posts'));
}
public function show(string $slug): View
{
$post = Post::query()
->published()
->with(['category', 'author', 'seo'])
->where('slug', $slug)
->firstOrFail();
$relatedPosts = $post->relatedPosts()->get();
return view('blog.show', compact('post', 'relatedPosts'));
}
public function category(string $slug): View
{
$category = Category::where('slug', $slug)->firstOrFail();
$posts = Post::query()
->where('category_id', $category->id)
->published()
->with(['category', 'author', 'seo'])
->latest('published_at')
->paginate(config('ink.per_page', 12));
return view('blog.category', compact('category', 'posts'));
}
public function tag(string $slug): View
{
$tag = Tag::where('slug', $slug)->firstOrFail();
$posts = Post::query()
->whereHas('tags', fn ($q) => $q->where('blog_tags.id', $tag->id))
->published()
->with(['category', 'author', 'seo'])
->latest('published_at')
->paginate(config('ink.per_page', 12));
return view('blog.tag', compact('tag', 'posts'));
}
public function preview(Post $post): View
{
return view('blog.preview', ['post' => $post->loadMissing(['category', 'author', 'seo'])]);
}
public function feed(): Response
{
$posts = Post::query()
->published()
->with(['category', 'author'])
->latest('published_at')
->limit(20)
->get();
return response()
->view('blog.feed', compact('posts'))
->header('Content-Type', 'application/rss+xml; charset=UTF-8');
}
}
Use the package's Blade components inside your own page templates:
<x-your-layout>
[@push](https://github.com/push)('head')
<x-ink::meta-tags :post="$post" />
<x-ink::feed-link />
[@endpush](https://github.com/endpush)
<x-ink::structured-data :post="$post" />
<x-ink::post-header :post="$post" />
<x-ink::post-body :post="$post" />
<x-ink::related-posts :posts="$relatedPosts" />
</x-your-layout>
<x-your-layout>
[@foreach](https://github.com/foreach)($posts as $post)
<x-ink::post-card :post="$post" />
[@endforeach](https://github.com/endforeach)
{{ $posts->links() }}
</x-your-layout>
<x-ink::feed :posts="$posts" />
Useful in your views:
$post->readingTime(); // int — minutes
$post->relatedPosts(3); // Builder of same-category, published, !=$this->id
$post->getUrl(); // route('blog.show', $post->slug) if registered, else fallback
The package checks for these names when generating URLs. If a route is missing, the helper returns #:
| Name | Purpose |
|---|---|
blog.index |
Listing page |
blog.show |
Single post (slug) |
blog.category |
Category archive (slug) |
blog.tag |
Tag archive (slug) |
blog.preview |
Signed draft preview (post) |
blog.feed |
RSS feed |
If writing all this gets old, flip the flag in config and delete your controller — the package will register equivalent routes automatically. See Public-routes mode.
How can I help you explore Laravel packages today?