katonfajar / laravel-blocks
A complete Gutenberg-style editing experience for Laravel.
Package info
github.com/katonfajar123/laravel-blocks
Language:JavaScript
pkg:composer/katonfajar/laravel-blocks
Requires
- php: ^8.2
- ext-fileinfo: *
- illuminate/console: ^11.0 || ^12.0 || ^13.0
- illuminate/contracts: ^11.0 || ^12.0 || ^13.0
- illuminate/filesystem: ^11.0 || ^12.0 || ^13.0
- illuminate/http: ^11.0 || ^12.0 || ^13.0
- illuminate/routing: ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^11.0 || ^12.0 || ^13.0
- illuminate/view: ^11.0 || ^12.0 || ^13.0
Requires (Dev)
- larastan/larastan: ^3.10
- laravel/pint: ^1.30
- orchestra/testbench: ^9.17 || ^10.11 || ^11.1
- pestphp/pest: ^3.8 || ^4.7 || ^5.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-22 20:15:43 UTC
README
A complete Gutenberg-style editing experience for Laravel.
Laravel Blocks is planned as a ready-to-use visual block editor for Laravel. It is designed to give authors a polished Gutenberg-style canvas while letting Laravel applications own their content, models, persistence, Blade output, and custom PHP blocks.
Important
This repository currently contains the package/toolchain foundation, canonical Document v1 boundary, PHP Block Registry, server-side schema validator, safe Blade renderer, PHP-to-editor manifest bridge, precompiled asset distribution and installer, a replaceable media-provider contract with a zero-database Laravel Filesystem default and host-authorized browser transport, a provider-backed media library for Image, Gallery, Video, and File plus Video poster and WebVTT caption selection, a minimal editor shell, the internal editor selection/command layer, package-owned UI primitives, rich-text and link controls, top-level block controls, a manifest-driven block inserter/appender, slash commands, a generated Inspector sidebar, visible undo/redo controls with platform shortcuts, top-level drag/drop, Document/List View, and default Paragraph, Heading, List, Quote, Code, Image, Gallery, Video, and File blocks. Full mark rendering, nested controls, Cover, and the remaining built-in block catalog remain target milestones until implemented.
Developer experience
Install the package:
composer require katonfajar/laravel-blocks php artisan laravel-blocks:install
Add the editor to a Blade form:
<x-laravel-blocks::editor name="content" :value="$post->content" />
The target component includes direct visual editing, selection, contextual and rich-text toolbars, popovers, link editing, the Inserter, slash commands, block movement, drag/drop, a generated Settings Inspector, Document/List View, media picking, nested blocks, patterns, reusable blocks, history, and keyboard navigation. These are core product requirements, not integration work delegated to the consuming application.
Validate and store the submitted Tiptap JSON in an existing TEXT or LONGTEXT field:
use KatonFajar\LaravelBlocks\Documents\Document; use KatonFajar\LaravelBlocks\Rules\BlockDocument; $validated = $request->validate([ 'content' => ['nullable', new BlockDocument], ]); $post->update([ 'content' => Document::from($validated['content'] ?? null)->toJson(), ]);
JSON/JSONB columns are recommended for new applications but are not required. See Installation and persistence for storage-specific examples.
Render it on the frontend:
<x-laravel-blocks::content :content="$post->content" />
All essential editor JavaScript, CSS, Vue, Tiptap, ProseMirror, positioning logic, and UI primitives MUST ship precompiled in the Composer distribution. A consuming application MUST NOT need Node.js, npm/pnpm/yarn, Vue, Tiptap, ProseMirror, Vite configuration, or a frontend build for the default editor.
Product direction
Laravel Blocks will provide:
- structured Tiptap JSON as the source of truth;
- Laravel-native registration, validation, rendering, and configuration;
- a complete visual content canvas with bundled toolbars, popovers, Inserter, Inspector, List View, media UI, and keyboard interactions;
- an internally bundled Vue 3 + Tiptap 3 editor with no frontend-build requirement for consumers;
- Gutenberg-comparable interaction quality and editing capability where applicable;
- an independent Laravel Blocks design system, visual identity, tokens, icons, and component styling;
- nested blocks and a curated set of 50 built-in blocks;
- custom blocks defined primarily in PHP;
- first-class Blade component and dynamic Eloquent blocks;
- replaceable media storage and overrideable frontend block Blade views;
- zero required package tables, migrations, or Eloquent models;
- a simple default experience with extensible advanced APIs.
It is not intended to be a CMS, a full page builder, a generic rich-text wrapper, or a pixel-for-pixel Gutenberg clone. Laravel Blocks copies the lessons, not the screenshot.
Product-owned editor surface
The default editor is a Laravel Blocks product surface. The editor shell, canvas structure, toolbar layout, Inserter, slash menu, Inspector, popovers, modals, selection UI, keyboard behavior, responsive behavior, icons, design tokens, and .lb-* control classes are owned by the package and are not a supported override API.
Applications extend the editor by registering blocks, fields, patterns, media providers, and safe frontend render views. Laravel Blocks renders those capabilities through its master editor UI.
Zero-database core
Laravel Blocks does not own your content or database.
The host application decides which model, table, connection, API, or custom repository stores the canonical Tiptap JSON document. Existing TEXT and LONGTEXT fields remain valid, while JSON/JSONB columns are a recommendation for new applications.
Core installation never creates or modifies application tables. Shared features such as reusable blocks or editor-managed custom patterns may opt into namespaced package tables or application-provided repository contracts later, but those migrations are always explicit and optional.
Documentation
The current documentation is a product and engineering specification:
- Documentation index
- Product definition
- Compatibility
- Architecture
- Fundamental decisions
- Document schema
- Installation and quick start
- Editor behavior
- Editor UX contract
- Design principles
- Built-in blocks
- Custom blocks
- Rendering
- Media
- Patterns and reusable blocks
- Configuration
- Integrations
- Security
- Roadmap
Compatibility
The package is tested around:
- PHP
^8.2; - Laravel / Illuminate
^11.0|^12.0|^13.0; - Composer 2;
- Vue 3 and Tiptap 3 as internal build dependencies.
| Laravel | Supported PHP | Laravel Blocks |
|---|---|---|
| 11.x | 8.2-8.4 | CI matrix |
| 12.x | 8.2-8.5 | CI matrix |
| 13.x | 8.3-8.5 | CI matrix |
PHP ^8.2 and the Laravel/Illuminate 11/12/13 target are frozen package constraints. The full compatibility matrix is encoded explicitly in CI so invalid Laravel/PHP combinations are never inferred from a permissive job matrix.
Laravel 11 is upstream end-of-life and its currently resolvable framework versions have active security advisories. The Laravel 11 CI lanes therefore prove package API compatibility under an explicit advisory-block exception; they do not represent a security-support recommendation for new deployments.
Package identity
| Item | Value |
|---|---|
| Product | Laravel Blocks |
| GitHub | katonfajar123/laravel-blocks |
| Composer | katonfajar/laravel-blocks |
| PHP namespace | KatonFajar\LaravelBlocks |
| License | MIT |
| Brand assets | Logo ยท Icon |
Development status
The fundamental architecture and mandatory Editor UX are specified. The runnable package/toolchain, immutable canonical Document v1 normalization boundary, abstract PHP Block contract, container-backed Block Registry, executable block/mark schemas, server-authoritative document validator, safe Blade renderer, PHP-to-editor Manifest v1 bridge, precompiled asset installer/distribution boundary, typed media-provider values, Laravel Filesystem default, authorized media transport and purpose-filtered Image/Gallery/Video/File/poster/WebVTT picker, minimal Vue/Tiptap editor shell, shared editor selection/command layer, UI primitive/Popover infrastructure, rich-text and link controls, top-level block controls, manifest-driven inserter/appender, slash commands, generated Inspector sidebar, visible undo/redo controls with Ctrl/Cmd shortcuts, top-level drag/drop, Document/List View, and package-owned Paragraph, Heading, List, Quote, Code, URL-backed Image, multi-select Gallery, caption-capable URL-backed Video, and PDF-only File blocks are implemented.
The 0.1 release gate is encoded as an explicit Laravel/PHP CI matrix plus host-persistence, precompiled-installation, and zero-database integration tests. No release or version tag is created by that gate. See the public roadmap for the planned release sequence.
