Build Custom PagibleAI Packages

PagibleAI CMS is fully modular. Instead of requiring the full aimeos/pagible meta-package, you can build your own Composer package that only includes the sub-packages you need. This keeps your dependencies lean and your application focused.

Table of Contents:

Available Packages

Package Composer Name What It Provides
Core aimeos/pagible-core Models, permissions, tenancy, migrations, utilities — required by all other packages
Admin aimeos/pagible-admin Vue 3 admin panel with GraphQL backend
GraphQL aimeos/pagible-graphql GraphQL API for content management (Lighthouse)
Theme aimeos/pagible-theme Frontend rendering with Blade templates, sitemap, contact form
AI aimeos/pagible-ai AI content generation, image manipulation, translation (Prism PHP)
Search aimeos/pagible-search Full-text search via Laravel Scout with custom CMS engine
JSON:API aimeos/pagible-jsonapi Read-only JSON:API for headless frontends
MCP aimeos/pagible-mcp Model Context Protocol server with 33 tools for AI agents
Import aimeos/pagible-import Importers for WordPress, Joomla, Drupal, Statamic, TYPO3

Package Dependencies

Every sub-package requires aimeos/pagible-core. Some packages have additional dependencies:

  • Admin requires GraphQL (for the admin backend API)
  • AI optionally uses GraphQL (for AI mutations) and MCP (for AI tools)
  • Search requires Laravel Scout (included in core)

All other packages only depend on core and can be combined freely.

Creating a Custom Package

1. Set up your composer.json

Create a composer.json for your custom package that requires only the PagibleAI sub-packages you need:

{
    "name": "your-vendor/your-cms-package",
    "description": "Custom CMS package built on PagibleAI",
    "type": "library",
    "license": "MIT",
    "require": {
        "aimeos/pagible-core": "~0.10",
        "aimeos/pagible-graphql": "~0.10",
        "aimeos/pagible-theme": "~0.10"
    },
    "autoload": {
        "psr-4": {
            "YourVendor\\YourPackage\\": "src/"
        }
    },
    "extra": {
        "laravel": {
            "providers": [
                "YourVendor\\YourPackage\\ServiceProvider"
            ]
        }
    }
}

2. Create a service provider

Your service provider can extend the functionality of the included PagibleAI packages:

namespace YourVendor\YourPackage;

use Illuminate\Support\ServiceProvider as Base;

class ServiceProvider extends Base
{
    public function boot(): void
    {
        // Register custom content element schemas
        $this->mergeConfigFrom(__DIR__ . '/../config/cms.php', 'cms');

        // Add custom routes, views, or commands
        $this->loadRoutesFrom(__DIR__ . '/../routes/web.php');
    }
}

3. Register an install command (optional)

If your package needs setup steps, register an install command following the PagibleAI naming convention. The meta-package's cms:install command auto-discovers all cms:install:* commands:

namespace YourVendor\YourPackage\Commands;

use Illuminate\Console\Command;

class Install extends Command
{
    protected $signature = 'cms:install:yourpackage';
    protected $description = 'Install YourPackage CMS extension';

    public function handle(): void
    {
        $this->call('vendor:publish', [
            '--provider' => 'YourVendor\YourPackage\ServiceProvider',
            '--tag' => 'config'
        ]);

        $this->info('YourPackage installed successfully!');
    }
}

Example: Headless API Package

A headless CMS that exposes content via both GraphQL and JSON:API, without any frontend rendering:

{
    "name": "your-vendor/headless-cms",
    "description": "Headless CMS API built on PagibleAI",
    "type": "library",
    "require": {
        "aimeos/pagible-core": "~0.10",
        "aimeos/pagible-graphql": "~0.10",
        "aimeos/pagible-jsonapi": "~0.10"
    }
}

This gives you:

  • Core — Models, migrations, permissions, tenancy
  • GraphQL — Full CRUD API for content management at /graphql
  • JSON:API — Read-only REST API for frontend consumption at /cms/*

Install with:

composer req your-vendor/headless-cms
php artisan cms:install:core
php artisan cms:install:graphql
php artisan cms:install:jsonapi
php artisan migrate

Example: Full CMS with AI

A complete CMS with admin UI, frontend rendering, AI features, and search:

{
    "name": "your-vendor/full-cms",
    "description": "Full AI-powered CMS built on PagibleAI",
    "type": "library",
    "require": {
        "aimeos/pagible-core": "~0.10",
        "aimeos/pagible-admin": "~0.10",
        "aimeos/pagible-graphql": "~0.10",
        "aimeos/pagible-theme": "~0.10",
        "aimeos/pagible-ai": "~0.10",
        "aimeos/pagible-search": "~0.10"
    }
}

This gives you:

  • Core — Foundation layer
  • Admin — Vue 3 admin panel at /cmsadmin
  • GraphQL — Backend API for the admin panel
  • Theme — Blade-based frontend rendering with caching
  • AI — Content generation, image manipulation, translation
  • Search — Full-text search with custom Scout engine

Install with:

composer req your-vendor/full-cms
php artisan cms:install
php artisan migrate

Note: When the meta-package is not used, run each sub-package's install command individually or create your own cms:install command that calls them in sequence.

Running Install Commands

Each PagibleAI sub-package registers its own cms:install:* artisan command:

Command Package
cms:install:core pagible-core
cms:install:graphql pagible-graphql
cms:install:jsonapi pagible-jsonapi
cms:install:search pagible-search
cms:install:ai pagible-ai
cms:install:theme pagible-theme
cms:install:mcp pagible-mcp

You only need to run the install commands for the packages you have required. The install commands publish config files, migrations, and assets specific to each package.