PHPackages                             warmar/laravel-blog - 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. [Framework](/categories/framework)
4. /
5. warmar/laravel-blog

ActiveLibrary[Framework](/categories/framework)

warmar/laravel-blog
===================

A blog/news plugin for Laravel + Livewire

v1.0.3(3mo ago)016↓90%MITBladePHP ^8.1

Since Mar 26Pushed 3mo agoCompare

[ Source](https://github.com/warmar94/laravel-blog)[ Packagist](https://packagist.org/packages/warmar/laravel-blog)[ RSS](/packages/warmar-laravel-blog/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (4)Versions (13)Used By (0)

Laravel Blog by Warmar
======================

[](#laravel-blog-by-warmar)

**Docs:**

A fully-featured, drop-in blog package for Laravel 11+ built on Livewire 4 and Tailwind CSS v4. Write articles in a live rich-text editor that saves to structured JSON — making every piece of content 100% compatible with Laravel's localization system and AI translation pipelines out of the box.

---

Why JSON instead of HTML?
-------------------------

[](#why-json-instead-of-html)

Most blog editors save raw HTML. That makes translation impossible without parsing and re-rendering unpredictable markup.

Laravel Blog saves content as a structured JSON document where every text node is a discrete string. When rendering, each string passes through Laravel's `__()` helper — meaning your entire article body is automatically translatable via Laravel's standard language files or any AI translation pipeline that hooks into `handleMissingKeys`. No custom directives, no proprietary syntax.

```
{
  "type": "doc",
  "content": [
    {
      "type": "paragraph",
      "content": [
        { "type": "text", "text": "Hello world", "marks": [{ "type": "bold" }] }
      ]
    }
  ]
}
```

---

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

[](#requirements)

- PHP 8.2+
- Laravel 11 or 12
- Livewire 4.x
- Tailwind CSS v4
- `php artisan storage:link` already run

---

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

[](#installation)

```
composer require warmar/laravel-blog
```

Then run the install command:

```
php artisan blog:install
```

The installer will ask you:

- Whether to enable comments
- Whether to enable categories

It then publishes config, migrations, views, models and services to your application.

### Run migrations

[](#run-migrations)

```
php artisan migrate
```

### Add routes

[](#add-routes)

In `routes/web.php`:

```
use App\Livewire\Blog\BlogHome;
use App\Livewire\Blog\BlogShow;
use App\Livewire\Blog\BlogAdmin;

Route::get('/blog',        BlogHome::class)->name('blog.home');
Route::get('/blog/{slug}', BlogShow::class)->name('blog.show');
Route::get('/blog-admin',  BlogAdmin::class)->name('blog.admin');
```

### Protecting the admin route

[](#protecting-the-admin-route)

The package does not include built-in auth — protect the admin route using your project's existing middleware:

```
Route::get('/blog-admin', BlogAdmin::class)
    ->name('blog.admin')
    ->middleware(['auth', 'verified']); // or your own admin middleware
```

---

Configuration
-------------

[](#configuration)

After publishing, your `config/blog.php` will look like this:

```
