Download the PHP package joaoolival/laravel-blog-engine without Composer
On this page you can find all versions of the php package joaoolival/laravel-blog-engine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download joaoolival/laravel-blog-engine
More information about joaoolival/laravel-blog-engine
Files in joaoolival/laravel-blog-engine
Package laravel-blog-engine
Short Description A Laravel package that provides the core backend logic for blogs, including post management, publishing workflows, slugs, tags, categories, and authoring. Frontend framework-agnostic and UI-independent.
License MIT
Homepage https://github.com/joaoolival/laravel-blog-engine
Informations about the package laravel-blog-engine
Laravel Blog Engine
A blog engine for Laravel with Filament admin panel integration. Manage posts, authors, and categories with automatic responsive image optimization.
Requirements
- PHP 8.3+
- Laravel 12 or 13
- Filament 5
- Spatie Laravel Media Library 11
Installation
Configuration
Publish the configuration file to customize resource labels, navigation, and icons:
You can customize the following for Posts, Authors, and Categories in config/laravel-blog-engine.php:
label&plural_label: Custom names for resources.navigation_label: Label shown in the sidebar.navigation_group: Group resources under a specific sidebar group (default: "Blog").navigation_sort: Order in the navigation.navigation_icon: Heroicon name (e.g.,heroicon-o-pencil) for the sidebar icon.
Authorization
To restrict access to blog resources, simply create Policies for the models (BlogPost, BlogAuthor, BlogCategory). Filament will automatically detect and enforce them.
This allows you to define granular permissions for who can view, create, update, delete, and restore resources.
Then register them in your application's AuthServiceProvider (or AppServiceProvider in newer Laravel versions).
For more details, see the Filament Resource Authorization documentation.
Basic Usage
Content & Responsive Images
Post content is stored as an HTML string (database longtext). When building APIs, use the provided HTTP Resources to automatically render content with responsive images:
The resource transforms the content HTML, finding image tags with data-id and replacing them with:
- WebP conversion
srcsetattributes for responsive loading- Lazy loading and async decoding
Note: Accessing
$post->contentdirectly returns the raw HTML with custom attributes. UseBlogPostResourcefor fully rendered HTML with responsive images.
Facade Methods
| Method | Description |
|---|---|
getPublishedPosts(?int $perPage) |
Published posts (paginated or collection) |
getPostBySlug(string $slug) |
Single post by slug |
getRecentPosts(int $limit = 5) |
Most recent posts (for sidebars) |
getRelatedPosts(BlogPost $post, int $limit = 4) |
Related posts by category/tags |
searchPosts(string $query, ?int $perPage) |
Search posts by title/excerpt/content |
getAllAuthors() |
All visible authors |
getAuthorWithPosts(string $slug, ?int $perPage) |
Author with their posts |
getAllCategories() |
All visible categories |
getCategoryWithPosts(string $slug, ?int $perPage) |
Category with its posts |
Models
BlogPost
| Attribute | Type | Description |
|---|---|---|
title |
string |
Post title |
slug |
string |
URL-friendly identifier |
excerpt |
string \| null |
Short summary |
content |
string \| null |
HTML content (longtext) |
tags |
array \| null |
Post tags |
is_visible |
bool |
Visibility flag |
published_at |
Carbon \| null |
Publish date |
Scopes:
BlogAuthor
| Attribute | Type |
|---|---|
name, slug, email |
string |
bio, github_handle, twitter_handle |
string\|null |
BlogCategory
| Attribute | Type |
|---|---|
name, slug |
string |
description, seo_title, seo_description |
string\|null |
is_visible |
bool |
Admin Panel
Access the Filament admin at /admin:
/admin/blog-posts/admin/blog-authors/admin/blog-categories
Responsive Images
This package uses Spatie Media Library for image handling. Images are automatically converted to WebP with responsive variants.
For background processing, install Laravel Horizon:
Generating Demo Content
Quickly populate your blog with dummy content using the blog:generate command:
This will prompt for the number of authors, categories, and posts to create (defaults: 1, 1, 12).
You can also pass options directly:
Testing
Credits
Support
If you encounter any issues or have questions, please open an issue on GitHub.
License
MIT. See LICENSE.md.
All versions of laravel-blog-engine with dependencies
filament/filament Version ^5.0
filament/spatie-laravel-media-library-plugin Version ^5.0
illuminate/contracts Version ^12.0 || ^13.0
spatie/laravel-medialibrary Version ^11.17
spatie/laravel-package-tools Version ^1.16