Package Status
Ecosystem / Adoption
Documentation
Framework-neutral PHP contracts and MySQL storage for hierarchical categories, content, extensible fields, image roles, and assignments to Host-owned media.
Current published release candidate · v1.0.0-rc.2 on Packagist
maatify/php-category provides typed commands, repositories, and public read
APIs for managing a Category tree and its related content.
- Hierarchy, lifecycle, and deterministic ordering of Category records.
- Localized or unlocalized name and description, plus Host-defined fields with exact scopes.
- Host-defined image roles and exact-scope assignments to existing Media Asset IDs.
- Separate consumer visibility and management reads, with bounded lists and management pagination.
Composer admits PHP >=8.4.27 <8.5 || >=8.5.12 <9.0. The CI compatibility
matrix covers Stable PHP 8.4 and 8.5 at or above their approved patch floors.
Later PHP 8 minors have forward Composer eligibility and require separate Stable
qualification before support is claimed.
The package requires ext-ctype, ext-mbstring, ext-pdo, and
ext-pdo_mysql. It uses MySQL 8.0.16+ with InnoDB and enforced CHECK
constraints. Runtime dependencies are maatify/exceptions,
maatify/shared-common, and the exact maatify/php-persistence 1.0.0-rc.1
trial. See composer.json
for the declared constraints and local verification
for the Composer and runtime checks.
Install the published RC.2 from Packagist in your Composer project. Keep
minimum-stability: stable and explicitly allow the exact Persistence release
candidate required by Category.
composer require maatify/php-category:1.0.0-rc.2 maatify/php-persistence:1.0.0-rc.1@RCFor the previously published RC.1, use its tag documentation and MIT license. That artifact has different PHP and Persistence requirements.
Install the Category schema in the Host database. Pass the Host's PDO and clock to the factory:
use Maatify\Category\Content\Mutation\Command\CreateCategoryContentCommand;
use Maatify\Category\Factory\CategoryFactory;
use Maatify\Category\Lifecycle\Command\CreateCategoryCommand;
$category = CategoryFactory::create($pdo, $clock);
$categoryId = $category->categories()->create(new CreateCategoryCommand('clothing'));
$category->contents()->create(new CreateCategoryContentCommand($categoryId, null, 'Clothing', null));
$visibleCategory = $category->categories()->getById($categoryId);See the Usage Guide and runnable example for workflow steps and input, result, and ownership boundaries.
CategoryFactory returns one facade with five APIs. categories() manages the
tree, contents() manages name/description records, contentFields() manages
structured field values, imageRoles() manages the role registry, and
images() manages assignments. The Category Package Reference
defines the complete public inventory and persistence contract.
Consumer reads enforce active, non-deleted ancestor visibility. Management reads expose typed filters for administrative inspection. For exact scopes, a null language, platform, or role means the null value itself. Locale fallback and Media Asset resolution are Host responsibilities.
The Host owns the PDO connection, outer transaction, and clock. Services
reuse that connection and preserve Host commit and rollback. The package
classifies selected storage errors. Unclassified driver failures can
propagate as PDOException; the Host maps errors to its transport or UI.
- Consumer Usage Guide
- Executable examples
- Category Package Reference
- Schema setup
- Changelog
- Contributing
- Security policy
See local verification for Composer, static analysis, code style, MySQL tests, and external Composer consumer verification. Category is pre-Stable. See the Security Policy for support status.
The RC.2 artifact is proprietary to Maatify Ltd. Obtain written authorization before use by requesting a free license from support@maatify.dev. Include your organization name, if applicable, and an email address for the person who should receive security advisories and critical update notices. Maatify Ltd. uses those details to administer licenses and send those notices. See LICENSE for the terms.
Engineered by Mohamed Abdulalim (@megyptm)
Backend Lead & Technical Architect
https://www.maatify.dev