Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brokeyourbike/uid-keys-laravel
A simple drop-in solution for providing UUID and ULID support for the IDs of your Eloquent models.
https://github.com/brokeyourbike/uid-keys-laravel
eloquent hacktoberfest laravel laravel-package laravel-packages php php8 ulid uuid
Last synced: about 2 months ago
JSON representation
A simple drop-in solution for providing UUID and ULID support for the IDs of your Eloquent models.
- Host: GitHub
- URL: https://github.com/brokeyourbike/uid-keys-laravel
- Owner: brokeyourbike
- License: mpl-2.0
- Created: 2022-01-16T09:59:26.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-20T11:44:29.000Z (over 1 year ago)
- Last Synced: 2024-09-18T01:16:05.601Z (4 months ago)
- Topics: eloquent, hacktoberfest, laravel, laravel-package, laravel-packages, php, php8, ulid, uuid
- Language: PHP
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# uid-keys
[![Latest Stable Version](https://img.shields.io/github/v/release/brokeyourbike/uid-keys-laravel)](https://github.com/brokeyourbike/uid-keys-laravel/releases)
[![Total Downloads](https://poser.pugx.org/brokeyourbike/uid-keys/downloads)](https://packagist.org/packages/brokeyourbike/uid-keys)
[![Maintainability](https://api.codeclimate.com/v1/badges/a0f0de6de7485a62c2a3/maintainability)](https://codeclimate.com/github/brokeyourbike/uid-keys-laravel/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/a0f0de6de7485a62c2a3/test_coverage)](https://codeclimate.com/github/brokeyourbike/uid-keys-laravel/test_coverage)A simple drop-in solution for providing UUID and ULID support for the IDs of your Eloquent models.
## Installation
```bash
composer require brokeyourbike/uid-keys
```## Usage
```php
use Illuminate\Database\Eloquent\Model;
use BrokeYourBike\UidKeys\Database\Eloquent\Ulid;class ExampleModel extends Model
{
use Ulid;/**
* The "type" of the auto-incrementing ID.
*
* @var string
*/
protected $keyType = 'string';/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = false;
}
```## Inspiration
Code mainly stolen from the [goldspecdigital/laravel-eloquent-uuid](https://github.com/goldspecdigital/laravel-eloquent-uuid) package.## Authors
- [Ivan Stasiuk](https://github.com/brokeyourbike) | [Twitter](https://twitter.com/brokeyourbike) | [LinkedIn](https://www.linkedin.com/in/brokeyourbike) | [stasi.uk](https://stasi.uk)## License
[Mozilla Public License v2.0](https://github.com/brokeyourbike/uid-keys-laravel/blob/main/LICENSE)