macsidigital / laravel-uuid
Laravel UUID package
Fund package maintenance!
MacsiDigital
Installs: 1 239
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- illuminate/support: ^10.0
Requires (Dev)
- orchestra/testbench: ^8.0
- phpunit/phpunit: ^10.0
README
UUID's on Laravel models
Laravel UUID, a UUID helper Library
Support us
We invest a lot in creating open source packages, and would be grateful for a sponsor if you make money from your product that uses them.
Installation
This package can be used in Laravel 6.0 or higher.
You can install the package via composer:
composer require macsidigital/laravel-uuid
Usage
This is quite a simple package, which can be used to override the primary key to uuid, or to add an additional uuid field, our preferred option to keep an incrementing index.
Add a uuid field
// primary key implementation $table->uuid('id')->primary(); // or implementation for additional field $table->uuid('uuid'); });
That's it! unless we use a different column name for the uuid field, then we add the following method.
public function uuidColumn(): string { return 'id'; } });
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email info@macsi.co.uk instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.