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. joaoolival/laravel-blog-engine

ActiveLibrary

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.0.10(3mo ago)2127↓100%[1 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 1mo ago

READMEChangelog (8)Dependencies (15)Versions (13)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.0+

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/3.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 92% of packages

Maintenance85

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.6% 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 ~1 days

Total

11

Last Release

112d 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 (53 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

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

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[guava/filament-knowledge-base

A filament plugin that adds a knowledge base and help to your filament panel(s).

206120.5k1](/packages/guava-filament-knowledge-base)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[bezhansalleh/filament-plugin-essentials

A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster

27584.7k16](/packages/bezhansalleh-filament-plugin-essentials)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7565.0k4](/packages/guava-filament-modal-relation-managers)

PHPackages © 2026

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