Download the PHP package farsi/inertia-content without Composer
On this page you can find all versions of the php package farsi/inertia-content. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download farsi/inertia-content
More information about farsi/inertia-content
Files in farsi/inertia-content
Package inertia-content
Short Description Nuxt Content-compatible content engine for Laravel + Inertia
License MIT
Homepage https://github.com/farsidev/inertia-content
Informations about the package inertia-content
Inertia Content
A Nuxt Content-compatible content management system for Laravel + Inertia.js + Vue applications. Write Markdown, get Vue components, query with Laravel – all with build-time compilation and zero runtime overhead.
Latest Version: v1.0.0 (Stable)
Why Inertia Content?
Traditional CMS solutions force you to pass HTML through Inertia props or parse Markdown at runtime. Inertia Content takes a different approach: compile Markdown to Vue components at build time, while Laravel maintains full control over routing and access.
Key Benefits
- 📝 File-based content - Write Markdown files, get compiled Vue components
- ⚡ Build-time compilation - Zero runtime parsing, optimal performance
- 🔍 Powerful queries - Nuxt Content-style query API in PHP
- 🎯 Full TypeScript support - Type safety from PHP to Vue
- 🔥 Hot Module Replacement - Instant updates during development
- 🎨 Familiar API - If you know Nuxt Content, you already know this
- 🔐 Laravel-first - Server-side access control and routing
- 🚀 Production-ready - Caching, optimization, and security built-in
Installation
Inertia Content is a single Composer package that includes both PHP and JavaScript code.
The JavaScript/Vue components are TypeScript source files that your Vite will compile - no pre-built JavaScript.
📖 See How It Works for detailed explanation.
Setup
1. Add Vite Plugin
Add the Vite plugin to your vite.config.ts:
2. Create Content
Create markdown files in resources/content:
3. Add Routes
Add content routes to routes/web.php:
4. Render Content
Create a Vue component to render content:
Usage
Query Content (PHP)
Render Content (Vue)
ContentRenderer Component
Simple content rendering:
ContentDoc Component
Full document with header, TOC, and footer:
ContentList Component
List multiple content entries:
useContent Composable
For advanced use cases:
Frontmatter
Supported frontmatter fields:
Configuration
Publish the configuration file:
Available options in config/inertia-content.php:
Commands
Testing
How It Works
Inertia Content follows a unique architecture that respects both Laravel and Inertia.js philosophies:
Build Time
- Vite plugin scans
resources/content/**/*.md - Parses frontmatter, extracts headings, generates excerpts
- Compiles Markdown → Vue components
- Generates JSON manifest with metadata
Runtime
- Laravel queries the manifest (cached)
- Passes only the content key through Inertia (never HTML/Markdown)
- Vue dynamically imports the pre-compiled component
- Component renders instantly (already compiled)
Key Innovation
No HTML through Inertia props. No runtime Markdown parsing.
Laravel maintains authority over:
- ✅ Content queries and filtering
- ✅ Access control and permissions
- ✅ Routing decisions
Vue handles:
- ✅ Component rendering (pre-compiled)
- ✅ User interactions
- ✅ Client-side navigation
Comparison
| Feature | Inertia Content | Traditional CMS | Static Site Generators |
|---|---|---|---|
| Runtime Parsing | ❌ No | ✅ Yes | ❌ No |
| Build Performance | ⚡ Fast | N/A | ⚡ Fast |
| Laravel Integration | ✅ Native | ⚠️ API-based | ❌ Separate |
| Dynamic Queries | ✅ Yes | ✅ Yes | ❌ Limited |
| Type Safety | ✅ Full | ⚠️ Partial | ⚠️ Partial |
| HMR | ✅ Yes | ⚠️ Sometimes | ✅ Yes |
| Server Authority | ✅ Complete | ✅ Complete | ❌ No server |
Nuxt Content Compatibility
This package implements 80% of Nuxt Content v2 core features, adapted for Laravel + Inertia:
✅ Implemented:
- Query API (
Content::query()≈queryContent()) - Markdown parsing with frontmatter
- Heading extraction & TOC
- Navigation generation
- HMR support
- Vue components
- TypeScript support
⏳ Planned for v1.1:
- MDC (Markdown Components)
- Full-text search
- Syntax highlighting (Shiki)
- YAML/JSON file support
See Nuxt Content Comparison for detailed feature parity analysis.
Roadmap
- [x] Markdown compilation
- [x] Query API (Nuxt Content-compatible)
- [x] Vue components
- [x] HMR support
- [x] TypeScript support
- [ ] MDC (Markdown Components) - v1.1
- [ ] Full-text search - v1.1
- [ ] Shiki syntax highlighting - v1.1
- [ ] YAML/JSON support - v1.1
- [ ] Content versioning - v1.2
- [ ] Multi-language support - v1.2
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
See Security Policy for more details.
License
The MIT License (MIT). Please see License File for more information.
Credits
- Farsi Dev
- Inspired by Nuxt Content
- Built with Spatie's Laravel Package Skeleton
- All contributors
Package Architecture
This is a single Composer package that includes both PHP and JavaScript code.
📦 Installation: composer require farsi/inertia-content
📂 JavaScript: Included in vendor/farsi/inertia-content/resources/js/
🔌 Vite Plugin: Import from vendor directory
See Architecture for details.
Support
- ⭐ Star the repo
- 🐛 Report bugs via GitHub Issues
- 💬 Discuss features via GitHub Discussions
- 📖 Read the full documentation
All versions of inertia-content with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
inertiajs/inertia-laravel Version ^1.0|^2.0