PHPackages                             joaoolival/laravel-blog-engine - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. joaoolival/laravel-blog-engine

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

joaoolival/laravel-blog-engine
==============================

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.

v1.1.0(4mo ago)3209[2 PRs](https://github.com/joaoolival/laravel-blog-engine/pulls)MITPHPPHP ^8.3CI passing

Since Jan 8Pushed 1mo agoCompare

[ Source](https://github.com/joaoolival/laravel-blog-engine)[ Packagist](https://packagist.org/packages/joaoolival/laravel-blog-engine)[ Docs](https://github.com/joaoolival/laravel-blog-engine)[ GitHub Sponsors](https://github.com/joaoolival)[ RSS](/packages/joaoolival-laravel-blog-engine/feed)WikiDiscussions main Synced yesterday

READMEChangelog (9)Dependencies (31)Versions (16)Used By (0)

Laravel Blog Engine
===================

[](#laravel-blog-engine)

[![Latest Version on Packagist](https://camo.githubusercontent.com/42f892380a8a7dde2b0ab87a5ce2ddd234c7cf2489b794c133185fb8cb797a00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f616f6f6c6976616c2f6c61726176656c2d626c6f672d656e67696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/joaoolival/laravel-blog-engine)[![Total Downloads](https://camo.githubusercontent.com/4fe48d33362b59e1c97b28de1b0ef39556a17ee1c3d868aebe7f4db961b05e99/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f616f6f6c6976616c2f6c61726176656c2d626c6f672d656e67696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/joaoolival/laravel-blog-engine)[![PHP Version](https://camo.githubusercontent.com/0d4c561bca95d487bfa8ce8207cbb6b92e86e9ccfabd2759aef35af1f73e5a25/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a6f616f6f6c6976616c2f6c61726176656c2d626c6f672d656e67696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/joaoolival/laravel-blog-engine)[![License](https://camo.githubusercontent.com/6605c4f4586c03742856154b358a6a9702d23349fc17b0b8881468473566ee8e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a6f616f6f6c6976616c2f6c61726176656c2d626c6f672d656e67696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/joaoolival/laravel-blog-engine)

A blog engine for Laravel with Filament admin panel integration. Manage posts, authors, and categories with automatic responsive image optimization.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 12 or 13
- Filament 5
- Spatie Laravel Media Library 11

Installation
------------

[](#installation)

```
composer require joaoolival/laravel-blog-engine
php artisan blog-engine:install
php artisan storage:link
```

### Configuration

[](#configuration)

Publish the configuration file to customize resource labels, navigation, and icons:

```
php artisan vendor:publish --tag="laravel-blog-engine-config"
```

You can customize the following for Posts, Authors, and Categories in `config/laravel-blog-engine.php`:

- `label` &amp; `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

[](#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.

```
php artisan make:policy BlogPostPolicy --model=\Joaoolival\LaravelBlogEngine\Models\BlogPost
```

Then register them in your application's `AuthServiceProvider` (or `AppServiceProvider` in newer Laravel versions).

For more details, see the [Filament Resource Authorization documentation](https://filamentphp.com/docs/5.x/panels/resources/getting-started#authorization).

Basic Usage
-----------

[](#basic-usage)

```
use Joaoolival\LaravelBlogEngine\Facades\Blog;

$posts = Blog::getPublishedPosts(perPage: 12);
$post = Blog::getPostBySlug('my-post');
$authors = Blog::getAllAuthors();
$categories = Blog::getAllCategories();
```

Content &amp; Responsive Images
-------------------------------

[](#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:

```
use Joaoolival\LaravelBlogEngine\Http\Resources\Posts\BlogPostResource;

return new BlogPostResource($post);
```

The resource transforms the `content` HTML, finding image tags with `data-id` and replacing them with:

- WebP conversion
- `srcset` attributes for responsive loading
- Lazy loading and async decoding

> **Note:** Accessing `$post->content` directly returns the raw HTML with custom attributes. Use `BlogPostResource` for fully rendered HTML with responsive images.

Facade Methods
--------------

[](#facade-methods)

MethodDescription`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 postsModels
------

[](#models)

### BlogPost

[](#blogpost)

AttributeTypeDescription`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:**

```
BlogPost::whereIsPublished()->get();
BlogPost::whereIsDraft()->get();
BlogPost::whereIsVisible()->get();
```

### BlogAuthor

[](#blogauthor)

AttributeType`name`, `slug`, `email``string``bio`, `github_handle`, `twitter_handle``string|null`### BlogCategory

[](#blogcategory)

AttributeType`name`, `slug``string``description`, `seo_title`, `seo_description``string|null``is_visible``bool`Admin Panel
-----------

[](#admin-panel)

Access the Filament admin at `/admin`:

- `/admin/blog-posts`
- `/admin/blog-authors`
- `/admin/blog-categories`

Responsive Images
-----------------

[](#responsive-images)

This package uses [Spatie Media Library](https://spatie.be/docs/laravel-medialibrary) for image handling. Images are automatically converted to WebP with responsive variants.

For background processing, install Laravel Horizon:

```
composer require laravel/horizon
php artisan horizon:install
php artisan horizon
```

Generating Demo Content
-----------------------

[](#generating-demo-content)

Quickly populate your blog with dummy content using the `blog:generate` command:

```
php artisan blog:generate
```

This will prompt for the number of authors, categories, and posts to create (defaults: 1, 1, 12).

You can also pass options directly:

```
php artisan blog:generate --authors=3 --categories=5 --posts=50
```

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [João Olival](https://github.com/joaoolival)

Support
-------

[](#support)

If you encounter any issues or have questions, please [open an issue](https://github.com/joaoolival/laravel-blog-engine/issues) on GitHub.

License
-------

[](#license)

MIT. See [LICENSE.md](LICENSE.md).

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance84

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Recently: every ~16 days

Total

12

Last Release

138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c36db55339e490e00f6953cc2ffcc4c2beaacbc07848844c52879be71f41096?d=identicon)[joaoolival](/maintainers/joaoolival)

---

Top Contributors

[![joaoolival](https://avatars.githubusercontent.com/u/11340304?v=4)](https://github.com/joaoolival "joaoolival (56 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laraveljoaoolivallaravel-blog-engine

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/joaoolival-laravel-blog-engine/health.svg)

```
[![Health](https://phpackages.com/badges/joaoolival-laravel-blog-engine/health.svg)](https://phpackages.com/packages/joaoolival-laravel-blog-engine)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[statikbe/laravel-filament-flexible-content-blocks

The Laravel Filament Flexible Content Blocks package helps you to easily create content in Filament for any model, with predefined or custom blocks, and foreach block an extendable Blade view component.

17927.9k6](/packages/statikbe-laravel-filament-flexible-content-blocks)[tapp/filament-form-builder

User facing form builder using Filament components

133.5k6](/packages/tapp-filament-form-builder)[slimani/filament-media-manager

A media manager plugin for Filament.

179.7k1](/packages/slimani-filament-media-manager)[backstage/mails

View logged mails and events in a beautiful Filament UI.

16429.7k](/packages/backstage-mails)[tapp/filament-lms

204.4k](/packages/tapp-filament-lms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
