{"id":14987455,"url":"https://github.com/tattersoftware/codeigniter4-audits","last_synced_at":"2025-04-12T00:15:41.391Z","repository":{"id":38195792,"uuid":"179776974","full_name":"tattersoftware/codeigniter4-audits","owner":"tattersoftware","description":"Lightweight object logging for CodeIgniter 4","archived":false,"fork":false,"pushed_at":"2024-05-16T11:42:31.000Z","size":82,"stargazers_count":12,"open_issues_count":5,"forks_count":7,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-03-25T19:53:41.807Z","etag":null,"topics":[],"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/tattersoftware.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-06T01:44:54.000Z","updated_at":"2025-02-25T11:51:18.000Z","dependencies_parsed_at":"2024-06-19T16:05:00.190Z","dependency_job_id":"e4f65133-9019-435b-8021-750d1257af26","html_url":"https://github.com/tattersoftware/codeigniter4-audits","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":"0.47058823529411764","last_synced_commit":"4c36da34adfb0d829cd6645f0c442c5ca631500f"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-audits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-audits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-audits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-audits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tattersoftware","download_url":"https://codeload.github.com/tattersoftware/codeigniter4-audits/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054218,"owners_count":21039951,"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":[],"created_at":"2024-09-24T14:14:38.390Z","updated_at":"2025-04-12T00:15:41.366Z","avatar_url":"https://github.com/tattersoftware.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tatter\\Audits\nLightweight object logging for CodeIgniter 4\n\n[![](https://github.com/tattersoftware/codeigniter4-audits/workflows/PHPUnit/badge.svg)](https://github.com/tattersoftware/codeigniter4-audits/actions/workflows/phpunit.yml)\n[![](https://github.com/tattersoftware/codeigniter4-audits/workflows/PHPStan/badge.svg)](https://github.com/tattersoftware/codeigniter4-audits/actions/workflows/phpstan.yml)\n[![](https://github.com/tattersoftware/codeigniter4-audits/workflows/Deptrac/badge.svg)](https://github.com/tattersoftware/codeigniter4-audits/actions/workflows/deptrac.yml)\n[![Coverage Status](https://coveralls.io/repos/github/tattersoftware/codeigniter4-audits/badge.svg?branch=develop)](https://coveralls.io/github/tattersoftware/codeigniter4-audits?branch=develop)\n\n## Quick Start\n\n1. Install with Composer: `\u003e composer require tatter/audits`\n2. Update the database: `\u003e php spark migrate --all`\n3. Set up your models:\n\n```php\nuse Tatter\\Audits\\Traits\\AuditsTrait;\n\nclass JobModel extends Model\n{\n\tuse AuditsTrait;\n\tprotected $afterInsert = ['auditInsert'];\n\tprotected $afterUpdate = ['auditUpdate'];\n\tprotected $afterDelete = ['auditDelete'];\n```\n\n## Features\n\nProvides ready-to-use object logging for CodeIgniter 4\n\n## Installation\n\nInstall easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities\nand always be up-to-date:\n```console\n\u003e composer require tatter/audits\n```\n\nOr, install manually by downloading the source files and adding the directory to\n`app/Config/Autoload.php`.\n\nOnce the files are downloaded and included in the autoload, run any library migrations\nto ensure the database is setup correctly:\n```console\n\u003e php spark migrate --all\n```\n\n## Configuration (optional)\n\nThe library's default behavior can be altered by extending its config file. Copy\n**examples/Audits.php** to **app/Config/Audits.php** and follow the instructions in the\ncomments. If no config file is found in **app/Config** the library will use its own.\n\n## Usage\n\nOnce the library is included all the resources are ready to go and you just need to\nspecify which models and events to audit. Use AuditsTrait to add support to any models\nyou would like tracked:\n\n```php\nuse Tatter\\Audits\\Traits\\AuditsTrait;\n\nclass JobModel extends Model\n{\n\tuse AuditsTrait;\n```\n\nThen specify which events you want audited by assigning the corresponding audit methods\nfor those events:\n\n```php\n\tprotected $afterInsert = ['auditInsert'];\n\tprotected $afterUpdate = ['auditUpdate'];\n\tprotected $afterDelete = ['auditDelete'];\n```\n\nThe Audits library will create basic logs of each event in the `audits` table, for example:\n\n```\n| id | source | source_id | user_id | event  | summary  |          created_at |\n+----+--------+-----------+---------+--------+----------+---------------------+\n| 10 | sites  |        27 |       9 | create | 2 rows   | 2019-04-05 15:58:40 |\n| 11 | jobs   |        10 |       9 | update | 5 rows   | 2019-04-05 16:01:35 |\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftattersoftware%2Fcodeigniter4-audits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftattersoftware%2Fcodeigniter4-audits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftattersoftware%2Fcodeigniter4-audits/lists"}