dereuromark / cakephp-hashid

CakePHP plugin to use hashids for your database table lookups
MIT License
36 stars 13 forks source link

Hashid Plugin for CakePHP

Build Status Coverage Status Latest Stable Version Minimum PHP Version License Total Downloads Coding Standards

Exposes hashids as drop-in replacement for your numeric primary keys.

DEPRECATED This plugin is deprecated in favor of the more robust and future proof solution through exposing a dedicated field. See Expose plugin.

A CakePHP plugin to

This branch is for use with CakePHP 3.6+. See version map for details.

Why hashids?

Why not UUIDS?

UPDATE This is actually not true if you combine both AIID and UUIDs and use UUIDs only for external lookup but keep AIID for all internal joins and operations. As such the Expose plugin fully replaces this now.

Demo

See https://sandbox3.dereuromark.de/sandbox/hashids

Setup

composer require dereuromark/cakephp-hashid

and

bin/cake plugin load Hashid

Usage

See Documentation.

Alternatives

See this nice article on a different approach that would use both -allowing "int" for internal and "uuid" for external reference.