Unique
This is a Laravel package that lets you add uuid's to a selected field., (*1)
Install
Add the following to your composer.json
file:, (*2)
``` bash
"garethnic/unique": "dev-master", (*3)
Add the garethnic\ServiceProvider to your config/app.php providers array:
``` php
garethnic\Unique\UniqueServiceProvider::class,
Then run the following command to copy config file., (*4)
``` bash
$ vendor:publish, (*5)
## Usage
In your model import the trait:
``` php
namespace App;
use garethnic\Unique\Unique;
Then it's as simple as:, (*6)
``` php
class User extends Authenticatable
{
use Unique;, (*7)
...
You can specify which field to fill in the `config/unique.php` file:
``` php
return [
'field' => 'name'
];
Change log
Please see CHANGELOG for more information what has changed recently., (*8)
Testing
bash
$ composer test
, (*9)
Contributing
Please see CONTRIBUTING and CONDUCT for details., (*10)
License
The MIT License (MIT). Please see License File for more information., (*11)