Install PagibleAI CMS in Laravel

Install PagibleAI CMS in an existing Laravel 11, 12 or 13 application. The core CMS works without an AI provider, so you only need API keys for the AI tools you intend to use.

Before you start, confirm that:

  • Your Laravel application runs normally.
  • Composer is available.
  • Laravel can connect to your database.
  • APP_URL contains the URL you use to open the application, including a local development port.

If you still need a Laravel application, follow the Laravel installation guide. Select Laravel 11 or 12 from the documentation version menu when that matches your application.

Install the package

Create a Laravel project if you do not already have one:

composer create-project laravel/laravel pagible
cd pagible

Configure the database connection and APP_URL in .env before installing the CMS. For Laravel's local server, use:

APP_URL=http://localhost:8000

Install PagibleAI CMS from the application directory:

composer require aimeos/pagible
php artisan cms:install

The installer publishes the package configuration and assets, prepares the database, runs the migrations, and creates the public storage link. You do not need to run the initial migration a second time.

A successful installation ends with:

Congratulations! You successfully set up Pagible CMS!

Create an administrator

Grant the admin role to an existing application user:

php artisan cms:user --role=admin editor@example.com

Replace the address with the user's actual email address. If no matching user exists, the command creates one and asks you for a password.

Use the narrowest suitable role:

  • viewer can read CMS content.
  • editor can edit content but cannot publish or permanently delete it.
  • publisher can manage and publish content.
  • admin receives every CMS permission.

Run php artisan cms:user --roles to display the configured roles. See Authorization and Permissions for individual permissions, custom roles, and application authorization adapters.

Verify the installation

Confirm that Laravel registered the admin route, then start the local server:

php artisan route:list --path=cmsadmin
php artisan serve

The route list should contain GET|HEAD cmsadmin/{path?} with the name cms.admin. For the local server, open http://localhost:8000/cmsadmin. In another environment, append /cmsadmin to the configured APP_URL. Sign in with the user you configured and check that you can:

  • Open the page tree.
  • Create and save a draft page.
  • Upload an image or another file.
  • Preview the draft without publishing it.

If an upload URL points to the wrong host or port, correct APP_URL and run php artisan optimize:clear.

Keep assets and migrations current

Include these commands in your application update or deployment process after Composer installs new package versions:

php artisan vendor:publish --force --tag=cms-admin
php artisan vendor:publish --tag=cms-theme
php artisan migrate --force

The admin command replaces the compiled administration assets. The theme command leaves existing published theme files untouched. Review theme changes before overwriting customized files. Use migrate --force only in a trusted, automated production deployment.

Configure optional AI features

Add credentials only for the functions you use. For example:

GEMINI_API_KEY="..."
OPENAI_API_KEY="..."
DEEPL_API_KEY="..."

CMS_AI_WRITE_API_KEY="${GEMINI_API_KEY}"
CMS_AI_REFINE_API_KEY="${OPENAI_API_KEY}"
CMS_AI_TRANSLATE_API_KEY="${DEEPL_API_KEY}"

Each AI function has separate provider, model, API-key, and optional base-URL settings in the PagibleAI configuration. This lets you mix providers instead of configuring every supported service.

Keep credentials in environment variables or a secrets manager. Do not commit a populated .env file. After changing cached configuration, run php artisan optimize:clear.

Enable optional CMS features

Add only the features required by your application:

  • Protect public forms with the hCaptcha configuration guide.
  • Set CMS_MULTIDOMAIN=true when separate page trees must resolve through different domains.
  • Use shared-database tenant isolation as described in Multi-Tenancy SaaS Setup. PagibleAI CMS does not support one database connection per tenant.
  • Enable synchronized editor sessions with Real-Time Updates using Laravel Reverb.
  • When embedding the Vue administration interface in another Laravel backend, use the maintained PagibleAI admin layout as the source. It contains the current import map, routes, plugin data, storage settings, and optional Reverb configuration.

Prepare production and maintenance

Before serving the CMS in production:

  • Set APP_URL to the final HTTPS URL.
  • Use persistent storage for uploaded files and include it in your backups.
  • Run Laravel's scheduler every minute as described in Laravel task scheduling.
  • Check registered tasks with php artisan schedule:list. The output should include cms:publish every 30 minutes and model:prune daily.
  • Use a managed web server and PHP process manager instead of php artisan serve.
  • Rebuild cached configuration after environment changes.

PagibleAI CMS registers cms:publish every 30 minutes and model:prune daily. Do not add duplicate schedules to routes/console.php. Soft-deleted CMS records become eligible for pruning after 30 days by default.

Troubleshooting

The cms:install command is not available

Run composer dump-autoload, confirm that aimeos/pagible is installed, and retry. Laravel package discovery should register Aimeos\Cms\ServiceProvider automatically.

The admin URL returns a 404 response

Run php artisan route:list --path=cmsadmin. If the route is missing after installation, run php artisan optimize:clear and check that package discovery is enabled.

The user can sign in but cannot edit content

Run php artisan cms:user --role=editor user@example.com or assign another suitable role. Confirm that the command uses the same user model and database as the web application.

Uploaded files use the wrong URL or do not load

Set APP_URL to the exact browser URL, including its port, then run php artisan optimize:clear. Confirm that public/storage exists and the web server can read the configured public disk.

The admin interface is blank after an update

Republish the compiled assets with php artisan vendor:publish --force --tag=cms-admin, clear Laravel's caches, and reload the page without the browser cache.

An AI tool reports missing credentials

Configure the CMS_AI_*_API_KEY used by that tool, check its provider setting in config/cms/ai.php, and clear cached configuration. Other CMS features can run without that key.