{"id":15025021,"url":"https://github.com/qtsolv/laravel-auditors","last_synced_at":"2025-04-12T13:12:03.281Z","repository":{"id":47613834,"uuid":"396647934","full_name":"qtsolv/laravel-auditors","owner":"qtsolv","description":"Record created by, updated by and deleted by on Eloquent models automatically.","archived":false,"fork":false,"pushed_at":"2022-01-08T18:51:05.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-12T13:11:55.946Z","etag":null,"topics":["eloquent","laravel","php","security"],"latest_commit_sha":null,"homepage":"","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/qtsolv.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":"2021-08-16T06:13:28.000Z","updated_at":"2022-06-13T16:45:40.000Z","dependencies_parsed_at":"2022-07-21T23:02:24.608Z","dependency_job_id":null,"html_url":"https://github.com/qtsolv/laravel-auditors","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtsolv%2Flaravel-auditors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtsolv%2Flaravel-auditors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtsolv%2Flaravel-auditors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qtsolv%2Flaravel-auditors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qtsolv","download_url":"https://codeload.github.com/qtsolv/laravel-auditors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571878,"owners_count":21126522,"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":["eloquent","laravel","php","security"],"created_at":"2024-09-24T20:01:24.929Z","updated_at":"2025-04-12T13:12:03.253Z","avatar_url":"https://github.com/qtsolv.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quarks/laravel-auditors\n\nRecord created by, updated by and deleted by (if [SoftDeletes](https://laravel.com/docs/6.x/eloquent#soft-deleting) added) on [Eloquent](https://laravel.com/docs/6.x/eloquent) models automatically.\n\n[![Latest Version][latest-version-image]][latest-version-url]\n[![Downloads][downloads-image]][downloads-url]\n[![PHP Version][php-version-image]][php-version-url]\n[![License][license-image]](LICENSE)\n\n### Installation\n\n```bash\ncomposer require quarks/laravel-auditors\n```\n\n### Usage\n\nIn your migration classes, add the auditor columns to your table as below:\n\n```php\n/**\n * Run the migrations.\n *\n * @return void\n */\npublic function up()\n{\n    Schema::table('users', function (Blueprint $table) {\n        $table-\u003eauditors();\n    });\n}\n\n/**\n * Reverse the migrations.\n *\n * @return void\n */\npublic function down()\n{\n    Schema::table('users', function (Blueprint $table) {\n        $table-\u003edropAuditors();\n    });\n}\n```\n\nThen add the `HasAuditors` trait your model classes as follows:\n\n```php\nnamespace App\\Models;\n\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\nuse Quarks\\Laravel\\Auditors\\HasAuditors;\n\nclass User extends Authenticatable\n{\n    use HasAuditors;\n}\n```\n\nFrom now onwards, `createdBy`, `updatedBy` and `deletedBy` relations on this model will automatically be saved on\n`created`, `updated` and `deleted` model events respectively.\n\n### License\n\nSee [LICENSE](LICENSE) file.\n\n[latest-version-image]: https://img.shields.io/github/release/qtsolv/laravel-auditors.svg?style=flat-square\n[latest-version-url]: https://github.com/qtsolv/laravel-auditors/releases\n[downloads-image]: https://img.shields.io/packagist/dt/quarks/laravel-auditors.svg?style=flat-square\n[downloads-url]: https://packagist.org/packages/quarks/laravel-auditors\n[php-version-image]: http://img.shields.io/badge/php-7.2+-8892be.svg?style=flat-square\n[php-version-url]: https://www.php.net/downloads\n[license-image]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqtsolv%2Flaravel-auditors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqtsolv%2Flaravel-auditors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqtsolv%2Flaravel-auditors/lists"}