Blog
Laratic includes a comprehensive blog system with AI-powered content generation, AI-powered translations, multi-language support, and flexible post management.
Features
- Post Management - Create, edit, and manage blog posts
- AI Content Generation - Generate posts using AI with image generation
- Translations - Multi-language post support with AI translation
- Categories - Organize posts with multi-language category support
- SEO - Automatic SEO optimization for blog posts
- FAQ - Frequently asked questions about the blog system
Core Concepts
Reference Numbers
Each post has a unique reference number (format: REF-000001) that groups all translations of the same post together. This allows the system to maintain relationships between posts in different languages.
Slugs
Posts automatically generate URL-friendly slugs from their titles. For non-English posts, the language code is appended to ensure unique slugs across languages. If a title doesn't generate a valid slug (e.g., non-Latin characters), the system uses a hash-based fallback.
Languages
The blog supports multiple languages configured in config/languages.php. Each post can have translations that share the same reference number but use different language codes.
Post States
- Active/Inactive - Controls post visibility on the public blog
- Promoted - Featured posts appear prominently on the blog index
References
| Category | Path / Name | Description |
|---|---|---|
| Routes | GET /blog (blog) | Public blog index page |
| Routes | GET /blog/{slug} (posts.show) | Public blog post view |
| Routes | GET /admin/posts (admin.posts.index) | Admin posts management page |
| Routes | GET /admin/posts/create (admin.posts.create) | Create new post page |
| Routes | GET /admin/posts/{post}/edit (admin.posts.edit) | Edit post page |
| Controller | PostController | Handles public blog viewing (index and show) |
| Controller | Admin\PostController | Handles admin post management pages |
| Model | Models\Post | Post model with automatic slug and reference number generation |
| Livewire | Forms\Admin\EditPost | Post editing form with AI generation and translation support |
| Livewire | Admin\Posts\PostsTable | Admin posts listing table with search |
| Livewire | Admin\Posts\PublishPostBanner | Banner component for unpublished posts in admin |
| Livewire | Admin\Posts\ManageCategories | Modal component for creating and editing categories with translations |
| Livewire | Admin\Posts\CategoriesSelect | Multiselect component for assigning categories to posts |
| Jobs | Jobs\GeneratePostWithAi | Queued job for AI-powered post generation with image creation |
| Jobs | Jobs\TranslatePostWithAi | Queued job for AI-powered post translation |
| Migrations | create_posts_table | Migration for posts table with reference_number, slug, language, etc. |
| Migrations | create_ai_usage_post_table | Pivot table linking posts to AI usage records |
| Migrations | create_tag_tables | Migration for tags/categories tables using spatie/laravel-tags package |
| Views | pages/blog/index.blade.php | Public blog listing page |
| Views | pages/blog/show.blade.php | Public blog post detail page |
| Views | pages/admin/posts/index.blade.php | Admin posts management page |
| Views | pages/admin/posts/edit.blade.php | Admin post edit/create page |