Skip to content

Releases: vedavith/Entity-Forge

v2.2.1 - CI/CD pipeline Improvements

Choose a tag to compare

@vedavith vedavith released this 08 Jul 01:29
894171e

Entity Forge v2.2.1

Release Date: July 2026

🚀 Overview

This release focuses on improving stability, PHP compatibility, testing, and the overall developer experience. It introduces enhancements to the CI/CD pipeline and improves the quality assurance process across supported PHP versions.

✨ What's New

CI/CD

  • Added scheduled GitHub Actions workflows for continuous validation.
  • Improved automated testing across PHP 8.3, 8.4, and 8.5.
  • Added Composer validation during CI.
  • Improved dependency caching for faster workflow execution.

Testing & Code Quality

  • Added automated PHPStan static analysis.
  • Improved PHPUnit execution and reporting.
  • Added code coverage generation.
  • Enforced a minimum 80% line coverage threshold during CI.

PHP Compatibility

  • Added support for PHP 8.5.
  • Continued support for PHP 8.3 and PHP 8.4.
  • Improved compatibility with the latest Composer ecosystem.

Performance

  • Optimized Composer dependency installation.
  • Improved CI execution speed through dependency caching.

Developer Experience

  • Improved development workflow.
  • Enhanced automated validation.
  • General maintenance and internal code quality improvements.

📦 Installation

Install the latest version:

composer require entity-forge/entity-forge:^2.2.1

Or update an existing installation:

composer update entity-forge/entity-forge

🙌 Thank You

Thank you for using Entity Forge. Feedback, issues, and contributions are always welcome!

Full Changelog: v2.2.0...v2.2.1

v2.2.0 — Dynamic Schema Extension

Choose a tag to compare

@vedavith vedavith released this 01 Jul 04:13
6e6c7a1

What's new

Dynamic Schema Extension

Tenants can now define custom fields on any entity without touching migrations.

Add "metadata": true to an entity schema to opt in:

```json
{
"entity": "Account",
"metadata": true,
"fields": { "name": "string" }
}
```

This emits a `metadata JSON NULL` column in the migration and exposes three new repository methods:

```php
$repo->setMeta(42, 'vat_number', 'GB123456789');
$repo->getMeta(42, 'vat_number'); // 'GB123456789'
$repo->getAllMeta(42); // ['vat_number' => 'GB123456789']
```

Custom Field CLI

Manage per-tenant field definitions from the command line:

```bash
php bin/ef field:add accounts vat_number string --tenant=beta --label="VAT Number"
php bin/ef field:list accounts --tenant=beta
php bin/ef field:remove 1 --tenant=beta
```

tenant_fields registry table

`CoreSchemaManager` now auto-creates a `tenant_fields` table on boot to store field definitions. Works with both `shared` and `database` tenancy strategies.

Other changes

  • Added keywords, homepage, and authors to `composer.json` for Packagist discoverability
  • Expanded README with Dynamic Schema Extension usage examples and updated CLI reference table

Full changelog

v2.1.1...v2.2.0

v2.1.1 — Multi-tenant SaaS framework

Choose a tag to compare

@vedavith vedavith released this 27 Jun 17:00

What's Changed

  • bin/ef autoload path — Fixed resolution when installed as a Composer dependency (previously resolved inside the vendor package directory)
  • Console commands config path — All CLI commands now use getcwd() . '/config' instead of __DIR__-relative paths, so they work correctly from any project root
  • Table name pluralisation — Added Str::toTableName() with proper snake_case and English pluralisation (JournalEntryjournal_entries, not journalentrys). Used consistently across MigrationBuilder, EntityBuilder, and BaseRepository
  • Strategy-aware migrationsMigrationBuilder now accepts a $strategy parameter; tenant_id column is only emitted for the shared strategy. GenerateCommand and GenerateAllCommand read tenancy.strategy from config/application.yaml and pass it through
  • Tenant-scoped unique indexes — Unique indexes in shared strategy automatically prepend tenant_id as the first column, preventing cross-tenant unique constraint violations
  • FK columnsbelongsTo relations now emit INT NOT NULL FK columns (previously missing NOT NULL)
  • datetime type — Maps to DATETIME SQL type (previously fell through to TEXT)
  • BaseRepository::create() — Now returns the inserted row with id populated via lastInsertId()
  • MigrationRunner output — Accepts an injectable ?callable $output in the constructor; defaults to echo. Console commands inject $output->writeln() for Symfony Console formatting
  • TenantService::onboard() — Only calls TenantProvisioner::create() for database strategy; shared strategy registers the tenant row without provisioning a database
  • Request::capture() — Detects application/json Content-Type and parses php://input instead of relying on $_POST. Added json() helper method.

v2.1.0 — Multi-tenant SaaS framework

Choose a tag to compare

@vedavith vedavith released this 27 Jun 17:01
  • bin/ef autoload path — Fixed resolution when installed as a Composer dependency (previously resolved inside the vendor package directory)
  • Console commands config path — All CLI commands now use getcwd() . '/config' instead of __DIR__-relative paths, so they work correctly from any project root
  • Table name pluralisation — Added Str::toTableName() with proper snake_case and English pluralisation (JournalEntryjournal_entries, not journalentrys). Used consistently across MigrationBuilder, EntityBuilder, and BaseRepository
  • Strategy-aware migrationsMigrationBuilder now accepts a $strategy parameter; tenant_id column is only emitted for the shared strategy. GenerateCommand and GenerateAllCommand read tenancy.strategy from config/application.yaml and pass it through
  • Tenant-scoped unique indexes — Unique indexes in shared strategy automatically prepend tenant_id as the first column, preventing cross-tenant unique constraint violations
  • FK columnsbelongsTo relations now emit INT NOT NULL FK columns (previously missing NOT NULL)
  • datetime type — Maps to DATETIME SQL type (previously fell through to TEXT)
  • BaseRepository::create() — Now returns the inserted row with id populated via lastInsertId()
  • MigrationRunner output — Accepts an injectable ?callable $output in the constructor; defaults to echo. Console commands inject $output->writeln() for Symfony Console formatting
  • TenantService::onboard() — Only calls TenantProvisioner::create() for database strategy; shared strategy registers the tenant row without provisioning a database
  • Request::capture() — Detects application/json Content-Type and parses php://input instead of relying on $_POST. Added json() helper method

v2.0.0 — Multi-tenant SaaS framework

Choose a tag to compare

@vedavith vedavith released this 14 Jun 23:27
103ff27

Changelog

[v2.0.0] — 2026-06-15

Tenancy

  • Shared-table strategy (tenant_id column, auto-scoped queries)
  • Database-per-tenant strategy (connection-level isolation)
  • Four tenant resolvers: header, subdomain, JWT (Bearer token), session
  • TenantService: onboard, suspend, resume, offboard lifecycle
  • TenantProvisioner: atomic DB creation with migration rollback on failure
  • RequestLifecycle: safe static state reset for worker-mode PHP

HTTP Layer

  • Immutable Pipeline with outermost-first middleware execution
  • AuthMiddlewareInterface integration point for auth providers
  • Router backed by FastRoute with {param} segments
  • Immutable Request/Response value objects; request attributes
  • Response streaming mode

Code Generation

  • EntityBuilder: belongsTo → typed nullable property, hasMany → typed array property
  • MigrationBuilder: FOREIGN KEY constraints, INDEX / UNIQUE INDEX clauses
  • Topological sort in generate:all for dependency-ordered timestamps
  • make:middleware and make:controller scaffolding commands

Migration System

  • Batch-tracked forward/rollback with dry-run mode
  • migrate:all-tenants with --parallel N concurrent worker processes
  • Suspended tenants skipped from bulk migrations

Infrastructure

  • DI container with reflection-based auto-wiring
  • PHPStan at level 8, clean
  • CI matrix: PHP 8.3, 8.4, 8.5
  • Codecov coverage reporting
  • .gitattributes for Packagist dist archive exclusions

What's Changed

  • Feature/forge multi tenant by @vedavith in #3
  • Implement CLEANUP.md fixes: security, DI, routing, streaming, concurrency, and generator improvements by @vedavith in #4
  • Update readme to reflect current implementation by @vedavith in #5
  • Feature/forge multi tenant by @vedavith in #6
  • Multi-tenant enhancements: JWT resolver, PHPStan, HTTP layer, coverage by @vedavith in #7
  • Feature/forge multi tenant by @vedavith in #8
  • Multi-tenant SaaS framework: resolvers, scaffolding, auth layer, and polish by @vedavith in #9
  • Feature/forge multi tenant by @vedavith in #10
  • Merge pull request #10 from vedavith/feature/forge-multi-tenant by @vedavith in #11
  • Feature/forge multi tenant by @vedavith in #12
  • Docs sync, .gitattributes, and CLI reference updates by @vedavith in #13

New Contributors

Full Changelog: https://github.com/vedavith/Entity-Forge/commits/v2.0.0