Permission Requirements
All blog management features require the
access.admin.panel permission. Additionally, post creation and editing use Laravel’s Gate authorization.Blog Post List
View and manage all blog posts at/admin/blog/posts.
Features
- Paginated post listing (10 posts per page)
- Quick edit and delete actions
- Post status indicators
- Author information
Creating a Blog Post
Create new blog posts with rich content, categories, and tags.Fill Post Details
Enter title, body content, and slug. The system validates:
- Title: Required, unique, 8-255 characters
- Slug: Required, unique (for URL-friendly permalinks)
- Body: Required (rich text content)
Validation Rules
Authorization Gate
Post creation is protected by Laravel’s Gate authorization:Editing Blog Posts
Edit existing blog posts at/admin/blog/posts/{post}/edit.
Edit Validation
Livewire Blog Edit Component
TheBlogEdit Livewire component provides reactive editing:
Deleting Blog Posts
Delete posts with authorization checks.Blog Categories
Organize posts into categories at/admin/blog/categories.
Category Features
- Create and manage blog categories
- Assign multiple posts to a category
- Categories are optional but recommended
Post-Category Relationship
Tags System
Use tags for flexible content organization.Tag Features
- Multiple tags per post
- Tag-based filtering
- Managed through the post editor
Post-Tag Relationship
Syncing Tags
Tags are synchronized during post creation and updates:Post Model Structure
The Post model defines core attributes and relationships:Image Management
Uploading Post Images
Images are stored using Laravel’s storage system:Image Storage Location
- Storage path:
storage/app/public/images/ - Public URL:
storage/images/{filename} - Disk:
public(configured inconfig/filesystems.php)
Admin Blog Routes
All blog admin routes are prefixed with/admin and protected:
Best Practices
SEO-Friendly Slugs
SEO-Friendly Slugs
Always create unique, descriptive slugs for better SEO:
- Use lowercase letters
- Replace spaces with hyphens
- Avoid special characters
- Keep it concise (3-5 words)
Featured Images
Featured Images
Optimize images before upload:
- Recommended size: 1200x630px
- Format: JPG or PNG
- Optimize for web (compress to reduce file size)
- Use descriptive filenames
Content Organization
Content Organization
Use categories and tags effectively:
- Categories: Broad topics (5-10 categories)
- Tags: Specific keywords (unlimited)
- Don’t duplicate categories as tags
Authorization
Authorization
Troubleshooting
Validation Errors
Validation Errors
Common validation issues:
- Duplicate slug: Change the slug to be unique
- Title too short: Must be at least 8 characters
- Missing body: Content is required
- Invalid category: Select from existing categories
Image Upload Failures
Image Upload Failures
Check the following:
- File size within server limits
- Storage directory is writable
- Symbolic link exists:
php artisan storage:link - Correct disk configuration in
config/filesystems.php
Authorization Denied
Authorization Denied
Next Steps
Gallery Management
Learn how to manage photos and albums
User Management
Manage users who can create blog posts