Search by

dereuromark / cakephp-expose

dereuromark

CakePHP Expose Plugin to expose entities through UUIDs instead of AIIDs

Package info

github.com/dereuromark/cakephp-expose

Homepage

Type:cakephp-plugin

pkg:composer/dereuromark/cakephp-expose

Statistics

Installs: 36 729

Dependents: 1

Suggesters: 1

Stars: 9

Open Issues: 0

2.3.3 2026-05-11 11:52 UTC

README

CI Codecov Latest Stable Version Minimum PHP Version License Total Downloads Coding Standards

Use UUIDs as public identifiers while keeping integer primary keys for internal relations. The default UUIDv4 generator does not encode record creation time or order. Your application controls entity accessibility and authorization.

Read the documentation website:

Package requirements are maintained in composer.json. For older CakePHP branches, see the version map.

Example

$articles->addBehavior('Expose.Expose');
$article = $articles->newEntity(['title' => 'First article']);
$articles->saveOrFail($article);

$found = $articles->find('exposed', uuid: $article->uuid)->firstOrFail();

Add a UUID schema column and protect its entity accessibility first, as shown in Getting started. The UUID is generated on saving a new entity; the ordinary primary key remains available internally.

Sandbox examples show public lookups in an application.