{"id":15286624,"url":"https://github.com/juniorb2ss/eloquentuuid","last_synced_at":"2025-04-13T03:33:04.686Z","repository":{"id":52416755,"uuid":"99608750","full_name":"juniorb2ss/EloquentUuid","owner":"juniorb2ss","description":"Trait to implement UUID in Eloquent ORM","archived":false,"fork":false,"pushed_at":"2021-04-29T20:18:03.000Z","size":16,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-26T20:49:33.291Z","etag":null,"topics":["composer","eloquent","laravel","orm","uuid"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juniorb2ss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-07T18:43:10.000Z","updated_at":"2019-09-03T22:01:28.000Z","dependencies_parsed_at":"2022-08-24T20:40:10.752Z","dependency_job_id":null,"html_url":"https://github.com/juniorb2ss/EloquentUuid","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniorb2ss%2FEloquentUuid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniorb2ss%2FEloquentUuid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniorb2ss%2FEloquentUuid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniorb2ss%2FEloquentUuid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juniorb2ss","download_url":"https://codeload.github.com/juniorb2ss/EloquentUuid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248659780,"owners_count":21141181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","eloquent","laravel","orm","uuid"],"created_at":"2024-09-30T15:17:45.534Z","updated_at":"2025-04-13T03:33:04.652Z","avatar_url":"https://github.com/juniorb2ss.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eloquent UUID Trait\n\n[![Build Status](https://travis-ci.org/juniorb2ss/EloquentUuid.svg?branch=master)](https://travis-ci.org/juniorb2ss/EloquentUuid) [![Code Coverage](https://scrutinizer-ci.com/g/juniorb2ss/EloquentUuid/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/juniorb2ss/EloquentUuid/?branch=master) [![Laravel](https://img.shields.io/badge/Laravel-5.*-green.svg)](https://laravel.com) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/juniorb2ss/EloquentUuid/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/juniorb2ss/EloquentUuid/?branch=master) [![StyleCI](https://styleci.io/repos/99608750/shield?branch=master)](https://styleci.io/repos/84957945) [![Code Climate](https://codeclimate.com/github/juniorb2ss/EloquentUuid/badges/gpa.svg)](https://codeclimate.com/github/juniorb2ss/EloquentUuid) \n\n\nThe `juniorb2ss/eloquent-uuid` provider a simple trait to implement UUID to ORM.\n\n## Install\n\nYou can install this package via composer:\n\n``` bash\n$ composer require juniorb2ss/eloquent-uuid~1.*\n```\n\n## Eloquent Trait\n\n```php\nuse juniorb2ss\\EloquentUuid\\EloquentUuidTrait;\n\nclass User extends Authenticatable\n{\n    use Notifiable, EloquentUuidTrait;\n    \n    /**\n    * UUID Column name used\n    * \n    * @var string\n    * @optional \n    */\n    protected $uuidKey = 'uuid';\n}\n```\n\n## UUID Column\nYou need create new column in table model like `uuid` or custom name you can define in `uuidKey` model property\n\n## Example\n```php\n$fields = $request-\u003eonly(['email', 'name', 'password']);\n$user = User::create($fields); // Creating user with auto-inject uuid field\n\ndump($user-\u003etoArray());\n\n/*[\n    \"id\" =\u003e \"1\"\n    \"uuid\" =\u003e \"723e4628-7c35-11e7-89b1-0242bfc0df57\",\n    \"name\" =\u003e \"Magdalena Zboncak\"\n    \"email\" =\u003e \"nitzsche.katherine@gulgowski.com\"  \n  ]*/\n\n```\n\n## Scope On UUID\n\n```php\nuse App\\User;\n\n$user = (new User)-\u003eonUuid('aae5f3f1-0f22-4a8b-9291-d2a9649d1490')\n                  -\u003efirstOrFail();\n```\n\n## Tests\n\n```bash\ncomposer run test\n```\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Credits\n\n- [Carlos Eduardo](https://github.com/juniorb2ss)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniorb2ss%2Feloquentuuid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuniorb2ss%2Feloquentuuid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniorb2ss%2Feloquentuuid/lists"}