PHPackages                             oi-lab/oi-laravel-publish - 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. [Admin Panels](/categories/admin)
4. /
5. oi-lab/oi-laravel-publish

ActiveLibrary[Admin Panels](/categories/admin)

oi-lab/oi-laravel-publish
=========================

Recursive CMS pages with ordered blocks, code-defined templates, spatie/laravel-data props and attachments

v1.0.1(today)00MITPHPPHP ^8.2CI failing

Since Jul 1Pushed todayCompare

[ Source](https://github.com/oi-lab/oi-laravel-publish)[ Packagist](https://packagist.org/packages/oi-lab/oi-laravel-publish)[ RSS](/packages/oi-lab-oi-laravel-publish/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (10)Versions (3)Used By (0)

[![OI Laravel Notes](./assets/github-preview.png)](./assets/github-preview.png)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5f04622864726232865bcac982b6be4b0275fc03edaf3bd90303f6f060ede75e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f692d6c61622f6f692d6c61726176656c2d7075626c6973682e737667)](https://packagist.org/packages/oi-lab/oi-laravel-publish)[![Total Downloads](https://camo.githubusercontent.com/c01b1273b9a0225e43023e582b43a1bbc2a327a057a9cedf45a3e4a47a80e24d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f692d6c61622f6f692d6c61726176656c2d7075626c6973682e737667)](https://packagist.org/packages/oi-lab/oi-laravel-publish)[![Tests](https://camo.githubusercontent.com/99d63f20edb0d7f68e42301110c46bd373b8a04ed8b3592ece9a977457a057d5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f692d6c61622f6f692d6c61726176656c2d7075626c6973682f74657374732e796d6c3f6c6162656c3d7465737473)](https://github.com/oi-lab/oi-laravel-publish/actions)[![License](https://camo.githubusercontent.com/c3dfb62a190395505d7002d7bff2544c7cf2c1bb9dfa60b582b991d3b42f3477/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f692d6c61622f6f692d6c61726176656c2d7075626c697368)](LICENSE)

OI Laravel Publish
==================

[](#oi-laravel-publish)

Recursive CMS pages with ordered blocks, code-defined templates, `spatie/laravel-data` typed props, and `oi-lab/oi-laravel-attachments` media.

The package ships the **data layer only** — models, data, form requests, migrations, config and a template registry. It does not ship controllers, routes or views; your application wires the UI.

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

[](#requirements)

- PHP 8.2+
- Laravel 11, 12, or 13
- `oi-lab/oi-laravel-attachments` (media collections)
- `spatie/laravel-data`

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

[](#installation)

```
composer require oi-lab/oi-laravel-publish
```

Publish and run the migrations:

```
php artisan vendor:publish --tag=oi-laravel-publish-migrations
php artisan migrate
```

Optionally publish the configuration (to customise templates, models, renderers):

```
php artisan vendor:publish --tag=oi-laravel-publish-config
```

If your application exposes a key/value `Setting` model, seed the renderer settings:

```
php artisan publish:install-settings
```

Concepts
--------

[](#concepts)

ConceptWhat it is`PublishPage`A recursive page (`parent_id` → `children`) owning ordered `blocks` and a `cover`.`PublishBlock`An ordered block belonging to one page, owning `cover` + `slides`.`PublishTemplate`A code-defined descriptor (key, type, default props, typed `propsClass`). Not a DB table.`PublishTemplateRegistry`The catalogue of templates, from config + runtime registration.`PropsData` / `PropsCast`Typed, spatie-data props for the JSON `props` column, ts-compatible.Usage
-----

[](#usage)

```
use OiLab\OiLaravelPublish\Models\PublishPage;
use OiLab\OiLaravelPublish\Models\PublishBlock;

$home = PublishPage::create([
    'template_key' => 'landing',
    'name'         => 'Home',
    'slug'         => 'home',
]);

$about = PublishPage::create([
    'parent_id'    => $home->id,
    'template_key' => 'default',
    'name'         => 'About',
    'slug'         => 'about',   // unique per parent
]);

$hero = PublishBlock::create([
    'publish_page_id' => $home->id,
    'template_key'    => 'hero',
    'name'            => 'Hero',
    'key'             => 'hero',
    'props'           => ['heading' => 'Welcome', 'alignment' => 'center'],
]);

$home->blocks;            // ordered by `sort`
$hero->props->heading;    // 'Welcome' (typed HeroData)
$hero->template();        // PublishTemplateData
```

### Attachments

[](#attachments)

```
$home->attachFile($file, 'cover');
$hero->syncAttachments([$slideA, $slideB], 'slides');
```

### Resolving collaborators

[](#resolving-collaborators)

Always go through the static resolver so config overrides apply:

```
use OiLab\OiLaravelPublish\OiLaravelPublish;

OiLaravelPublish::pageModel();
OiLaravelPublish::template('hero');
OiLaravelPublish::blockTemplates();
```

Customizing models &amp; templates
----------------------------------

[](#customizing-models--templates)

Override the `models` and `templates` config entries, or register templates at runtime from a service provider:

```
use OiLab\OiLaravelPublish\Data\PublishTemplateData;
use OiLab\OiLaravelPublish\Enums\PublishTemplateType;
use OiLab\OiLaravelPublish\OiLaravelPublish;

OiLaravelPublish::registry()->register(new PublishTemplateData(
    key: 'pricing',
    name: 'Pricing table',
    type: PublishTemplateType::Block,
    propsClass: \App\Publish\PricingData::class,
));
```

Testing
-------

[](#testing)

```
composer test
```

AI Assistant Skills
-------------------

[](#ai-assistant-skills)

This package ships an AI assistant skill. Install it into a host app with:

```
php artisan oi:install-ai-skill
```

Testing
-------

[](#testing-1)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see the [License File](LICENSE) for more information.

Credits
-------

[](#credits)

**[Olivier Lacombe](https://www.olacombe.com)** - Creator and maintainer

Olivier is a Product &amp; Technology Director based in Montpellier, France, with over 20 years of experience innovating in UX/UI and emerging technologies. He specializes in guiding enterprises toward cutting-edge digital solutions, combining user-centered design with continuous optimization and artificial intelligence integration.

**Projects &amp; Resources:**

- [OI Dev Docs](https://dev.olacombe.com) - Documentation for all Open Source OI Lab packages
- [OnAI](https://onai.olacombe.com) - Training courses and masterclasses on generative AI for businesses
- [Promptr](https://promptr.olacombe.com) - Prompt engineering Management Platform

Support
-------

[](#support)

For support, please open an issue on the [GitHub repository](https://github.com/oi-lab/oi-laravel-attachments/issues).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/369876?v=4)[Olivier Lacombe](/maintainers/olacombe)[@olacombe](https://github.com/olacombe)

---

Top Contributors

[![olacombe](https://avatars.githubusercontent.com/u/369876?v=4)](https://github.com/olacombe "olacombe (2 commits)")

---

Tags

laravelcontentcmspublishpagesblocksoi-lab

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/oi-lab-oi-laravel-publish/health.svg)

```
[![Health](https://phpackages.com/badges/oi-lab-oi-laravel-publish/health.svg)](https://phpackages.com/packages/oi-lab-oi-laravel-publish)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.1k](/packages/larastan-larastan)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k55.0M612](/packages/laravel-scout)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M129](/packages/laravel-pulse)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M184](/packages/laravel-ai)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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