PHPackages                             dereuromark/cakephp-expose - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dereuromark/cakephp-expose

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

dereuromark/cakephp-expose
==========================

CakePHP Expose Plugin to expose entities through UUIDs instead of AIIDs

2.3.3(1mo ago)934.6k↑1846.7%21MITPHPPHP &gt;=8.2CI passing

Since Mar 5Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/dereuromark/cakephp-expose)[ Packagist](https://packagist.org/packages/dereuromark/cakephp-expose)[ Docs](https://github.com/dereuromark/cakephp-expose/)[ RSS](/packages/dereuromark-cakephp-expose/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (12)Versions (26)Used By (1)

CakePHP Expose plugin
=====================

[](#cakephp-expose-plugin)

[![CI](https://github.com/dereuromark/cakephp-expose/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/dereuromark/cakephp-expose/actions/workflows/ci.yml?query=branch%3Amaster)[![Codecov](https://camo.githubusercontent.com/552e71845bd18adda99dfa93751aaeb0e02346c37aad1a79582a8cf562fae8af/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6465726575726f6d61726b2f63616b657068702d6578706f73652f6d61737465722e737667)](https://codecov.io/gh/dereuromark/cakephp-expose)[![Latest Stable Version](https://camo.githubusercontent.com/aabf4512060a283f2b2b41512d9d08169bb3ef6f4fb9aa75f29ae2133dc73806/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d6578706f73652f762f737461626c652e737667)](https://packagist.org/packages/dereuromark/cakephp-expose)[![Minimum PHP Version](https://camo.githubusercontent.com/ec21f169d70b69344c67d6f18fa1a24d20476d2f0cd680e8c4a1534c22f34e5f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e322d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/84593f1ef4d8f281daf877145a5e2995eb4b00dbf75fd2cd9acd9e2bb181674e/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d6578706f73652f6c6963656e73652e737667)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/89d8d2efa6ccd261bb1d05e7965ee8546541e78bbf96fda2f2232c6b38d9c1f0/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d6578706f73652f642f746f74616c2e737667)](https://packagist.org/packages/dereuromark/cakephp-expose)[![Coding Standards](https://camo.githubusercontent.com/4788bab10b61ca8b0d56334238717a9191fe9cceecb154973f8854146a2bb5a6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63732d5053522d2d322d2d522d707572706c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/php-fig-rectified/fig-rectified-standards)

Exposes UUIDs as public identifiers for your entities instead of numeric AIID (Auto Increment ID) primary keys.

This branch is for use with **CakePHP 5.1+**. For details see [version map](https://github.com/dereuromark/cakephp-expose/wiki#cakephp-version-map).

Key Goals
---------

[](#key-goals)

Cloaking/Obfuscation

- True randomness, so you cannot determine order or count of records per time-frame.

Security

- Mass assignment and marshalling does not allow setting this exposed field - it are hidden by default just as the primary key.

Robustness

- Must work with also more complex queries and use cases, including the atomic `updateAll()`, `deleteAll()`.
- Speed should be similar to default approach.

Simplicity

- Code changes from AIID exposure to UUID lookup should be minimal for all public endpoints.
- The default shortener provided makes the UUIDs also only 22 chars long concise strings.

Why AIID and UUID as combination?
---------------------------------

[](#why-aiid-and-uuid-as-combination)

See [Motivation](docs/Motivation.md) for details.

Demo
----

[](#demo)

See [sandbox](https://sandbox4.dereuromark.de/sandbox/expose-examples) examples.

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [Composer](https://getcomposer.org/).

The recommended way to install is:

```
composer require dereuromark/cakephp-expose

```

Then load the plugin with the following command:

```
bin/cake plugin load Expose

```

Usage
-----

[](#usage)

See [Docs](/docs) for details.

### Quick Start for adding to existing records

[](#quick-start-for-adding-to-existing-records)

Faster than the speed of light:

- Add the behavior and run `bin/cake expose add_field PluginName.ModelName {MigrationName}` to generate a migration for adding the field.
- Execute the migration and then populate existing records using `bin/cake expose populate_field PluginName.ModelName`
- Re-run `bin/cake expose add_field PluginName.ModelName {MigrationName}` to get a non-nullable field migration for your new field.
- After also executing that migration all new records will automatically have their exposed field stored as well.

You are done and can now adjust your public actions to query by exposed field only and hide the primary key completely. Using `Superimpose` behavior on top of `Expose` means that you actually might not even have to modify any code. Should work out of the box.

More migration tips in [Migrating](docs/Migrating.md) section.

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance91

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 99.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~102 days

Recently: every ~43 days

Total

23

Last Release

53d ago

Major Versions

1.5.1 → 2.0.02023-10-10

PHP version history (5 changes)1.0.0-betaPHP &gt;=7.2

1.5.0PHP &gt;=7.3

1.5.1PHP &gt;=7.4

2.0.0PHP &gt;=8.1

2.3.1PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39854?v=4)[Mark Scherer](/maintainers/dereuromark)[@dereuromark](https://github.com/dereuromark)

---

Top Contributors

[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (209 commits)")[![CauanCabral](https://avatars.githubusercontent.com/u/83092?v=4)](https://github.com/CauanCabral "CauanCabral (1 commits)")[![stonecooler](https://avatars.githubusercontent.com/u/18571657?v=4)](https://github.com/stonecooler "stonecooler (1 commits)")

---

Tags

securitycakephphashidsobfuscateuuidexpose

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dereuromark-cakephp-expose/health.svg)

```
[![Health](https://phpackages.com/badges/dereuromark-cakephp-expose/health.svg)](https://phpackages.com/packages/dereuromark-cakephp-expose)
```

###  Alternatives

[hashids/hashids

Generate short, unique, non-sequential ids (like YouTube and Bitly) from numbers

5.4k52.1M317](/packages/hashids-hashids)[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

3361.0M51](/packages/dereuromark-cakephp-tools)[cakephp/bake

Bake plugin for CakePHP

11212.0M202](/packages/cakephp-bake)[dereuromark/cakephp-queue

The Queue plugin for CakePHP provides deferred task execution.

308954.9k25](/packages/dereuromark-cakephp-queue)[dereuromark/cakephp-ide-helper

CakePHP IdeHelper Plugin to improve auto-completion

1882.3M44](/packages/dereuromark-cakephp-ide-helper)[cybercog/laravel-optimus

An Optimus bridge for Laravel. Id obfuscation based on Knuth's multiplicative hashing method.

195578.5k](/packages/cybercog-laravel-optimus)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
