{"id":39339019,"url":"https://github.com/skore/laravel-auditable","last_synced_at":"2026-01-18T02:15:22.860Z","repository":{"id":57052652,"uuid":"246383106","full_name":"skore/laravel-auditable","owner":"skore","description":"Audit the users that performs actions to your application models","archived":false,"fork":false,"pushed_at":"2025-03-11T14:53:10.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-26T09:37:51.366Z","etag":null,"topics":["audits","eloquent-models","laravel","laravel-migrations","laravel-package","traits"],"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/skore.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-03-10T18:55:26.000Z","updated_at":"2025-03-11T14:50:39.000Z","dependencies_parsed_at":"2024-01-13T04:21:59.791Z","dependency_job_id":null,"html_url":"https://github.com/skore/laravel-auditable","commit_stats":{"total_commits":54,"total_committers":5,"mean_commits":10.8,"dds":"0.38888888888888884","last_synced_commit":"a4748ae3a8644f8d92aa82c19a6e9d297e555321"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/skore/laravel-auditable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skore%2Flaravel-auditable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skore%2Flaravel-auditable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skore%2Flaravel-auditable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skore%2Flaravel-auditable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skore","download_url":"https://codeload.github.com/skore/laravel-auditable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skore%2Flaravel-auditable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28526569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["audits","eloquent-models","laravel","laravel-migrations","laravel-package","traits"],"created_at":"2026-01-18T02:15:22.796Z","updated_at":"2026-01-18T02:15:22.849Z","avatar_url":"https://github.com/skore.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Auditable\n\nAudit the users that performs actions to your application models\n\n## Status\n\n[![packagist version](https://img.shields.io/packagist/v/skore-labs/laravel-auditable)](https://packagist.org/packages/skore-labs/laravel-auditable) [![tests](https://github.com/skore/laravel-auditable/actions/workflows/tests.yml/badge.svg)](https://github.com/skore/laravel-auditable/actions/workflows/tests.yml) [![StyleCI](https://github.styleci.io/repos/246383106/shield?style=flat\u0026branch=master)](https://github.styleci.io/repos/246383106) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8f09d7031fe341e1a8c8eed9120a0e7b)](https://www.codacy.com/gh/skore/laravel-auditable?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=skore/laravel-auditable\u0026amp;utm_campaign=Badge_Grade) [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/8f09d7031fe341e1a8c8eed9120a0e7b)](https://www.codacy.com/gh/skore/laravel-auditable/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=skore/laravel-auditable\u0026utm_campaign=Badge_Coverage) [![Scc Count Badge](https://sloc.xyz/github/skore/laravel-auditable?category=code)](https://github.com/skore/laravel-auditable) [![Scc Count Badge](https://sloc.xyz/github/skore/laravel-auditable?category=comments)](https://github.com/skore/laravel-auditable)\n\n## Getting started\n\n```\ncomposer require skore-labs/laravel-auditable\n```\n\nAnd write this on the models you want to have auditables:\n\n```php\n\u003c?php\n\nnamespace SkoreLabs\\LaravelAuditable\\Tests\\Fixtures;\n\nuse Illuminate\\Database\\Eloquent\\Model;\nuse Illuminate\\Database\\Eloquent\\SoftDeletes;\nuse SkoreLabs\\LaravelAuditable\\Traits\\Auditable;\n\nclass Post extends Model\n{\n    use Auditable;\n    // Add this one and it will auto-detect for the deletedBy\n    // use SoftDeletes;\n\n    /**\n     * The attributes that should be visible in serialization.\n     *\n     * @var array\n     */\n    protected $visible = ['title', 'content'];\n}\n```\n\nAnd this is how it should look like in your migration file:\n\n```php\n\u003c?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreatePostsTestTable extends Migration\n{\n    public function up()\n    {\n        Schema::create('posts', function (Blueprint $table) {\n            $table-\u003ebigIncrements('id');\n            $table-\u003estring('title');\n            $table-\u003etext('content');\n\n            $table-\u003etimestamps();\n            $table-\u003esoftDeletes();\n            $table-\u003eauditables();\n\n            // or if has softDeletes (deleted_at column):\n            $table-\u003eauditables(true);\n\n            // also you might want to rename the users table:\n            $table-\u003eauditables(true, 'my_users_table');\n        });\n    }\n\n    public function down()\n    {\n        Schema::dropIfExists('posts');\n    }\n}\n```\n\n**Note: If you wanna remove it on the `down` method of your migrations, you can use `dropAuditables`.**\n\n```php\n    public function down()\n    {\n        Schema::table('posts', function (Blueprint $table) {\n            $table-\u003edropAuditables();\n            // or if has softDeletes (deleted_at column):\n            $table-\u003edropAuditables(true);\n        });\n    }\n```\n\n### Methods\n\nThese are all the relationships that the `Auditable` trait provides to your model:\n\n```php\n$post = Post::first();\n\n$post-\u003ecreatedBy; // Author of the post\n$post-\u003eupdatedBy; // Author of the last update of the post\n$post-\u003edeletedBy; // Author of the deletion of the post\n\n$post-\u003eauthor; // Alias for createdBy\n```\n\n## Support\n\nThis and all of our Laravel packages follows as much as possibly can the LTS support of Laravel.\n\nRead more: https://laravel.com/docs/master/releases#support-policy\n\n## Credits\n\n- Ruben Robles ([@d8vjork](https://github.com/d8vjork))\n- Skore ([https://www.getskore.com/](https://www.getskore.com/))\n- [And all the contributors](https://github.com/skore-labs/laravel-status/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskore%2Flaravel-auditable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskore%2Flaravel-auditable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskore%2Flaravel-auditable/lists"}