Installation
Requirements
- PHP 8.1+
- ThinkPHP 8
- MySQL or MariaDB
- Composer
Install The Package
bash
composer require lartrix/lartrix-thinkIn local monorepo development, the host ThinkPHP application usually references lartrix-think through a Composer path repository.
Publish Assets
bash
php think thinkrix:publishPublishing includes:
- Admin frontend assets to
public/admin - Default configuration files
- Language files and required static assets
When changing the shared frontend, edit trix, build it, then publish or sync the built assets. Do not edit built admin assets directly.
Initialize Database
bash
php think thinkrix:installThe installer:
- Publishes frontend assets.
- Runs migrations, with a full table-creation fallback if migration constraints fail.
- Seeds base users, roles, permissions, menus, settings, and notification categories.
After installation, visit THINKRIX_PATH, which defaults to /admin.
Common Issues
Foreign Key Migration Failure
Some MySQL environments or existing tables may fail when creating foreign keys. The installer falls back to full table creation; verify that the base tables were created successfully.
Controller Not Found: app\controller\Api
Confirm Thinkrix routes are loaded and the request path includes the configured api_prefix, which defaults to /api/admin.