https://github.com/mitakeck/ulidtype
UlidType plugin for CakePHP
https://github.com/mitakeck/ulidtype
cakephp-plugin cakephp3
Last synced: about 1 month ago
JSON representation
UlidType plugin for CakePHP
- Host: GitHub
- URL: https://github.com/mitakeck/ulidtype
- Owner: mitakeck
- Created: 2019-09-26T04:28:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-01T07:12:35.000Z (over 6 years ago)
- Last Synced: 2025-07-16T00:26:39.611Z (8 months ago)
- Topics: cakephp-plugin, cakephp3
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# UlidType plugin for CakePHP
## Setup
### Install
```bash
$ composer require mitakeck/ulidtypes
```
### Bootstrap
- add plugin load command in `config/bootstrap.php`
```php
...
Plugin::load('mitakeck/UlidTypes', ['bootstrap' => true]);
...
```
### Model
- add `_initializeSchema()` method to `Model\Table` class to make id `ulid` type
```php
...
use Cake\Database\Schema\TableSchema;
...
class XXXXXXXXTable extends Table
{
protected function _initializeSchema(TableSchema $table)
{
parent::_initializeSchema($table);
$table->setColumnType('id', 'ulid'); // set ulid type for id
return $table;
}
}
...
```