{"id":36373787,"url":"https://github.com/amsrafid/laravel-activitylog","last_synced_at":"2026-01-11T14:03:51.996Z","repository":{"id":56947378,"uuid":"347844815","full_name":"amsrafid/laravel-activitylog","owner":"amsrafid","description":"Simple but powerful activity log package for laravel.","archived":false,"fork":false,"pushed_at":"2021-06-02T07:20:48.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T16:40:54.904Z","etag":null,"topics":["activity-log","activity-logger","easy","laravel","logging","package","php","plugin"],"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/amsrafid.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-03-15T05:12:54.000Z","updated_at":"2021-07-10T19:37:36.000Z","dependencies_parsed_at":"2022-08-21T07:50:10.207Z","dependency_job_id":null,"html_url":"https://github.com/amsrafid/laravel-activitylog","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/amsrafid/laravel-activitylog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsrafid%2Flaravel-activitylog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsrafid%2Flaravel-activitylog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsrafid%2Flaravel-activitylog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsrafid%2Flaravel-activitylog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amsrafid","download_url":"https://codeload.github.com/amsrafid/laravel-activitylog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amsrafid%2Flaravel-activitylog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28306985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["activity-log","activity-logger","easy","laravel","logging","package","php","plugin"],"created_at":"2026-01-11T14:03:51.932Z","updated_at":"2026-01-11T14:03:51.981Z","avatar_url":"https://github.com/amsrafid.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Laravel Activity Log\n\nSimple but very powerful activity log package for laravel framework.\n\n## Installation\n\nTo install this package, run this command to root directory of the project,\n\n~~~php\ncomposer require amsrafid/laravel-activitylog\n~~~\n\nTo publish config file of this package, run the following command,\n\n~~~php\nphp artisan vendor:publish --provider=\"Amsrafid\\ActivityLog\\ActivityLogServiceProvider\"\n~~~\n\n_Note: Publishing service provider is optional._\n\n## Get Started\n\nActivity log has to be started after migrating log table. To make migration, hit the command bellow to the terminal,\n\n~~~php\nphp artisan migrate\n~~~\n\n## Basic Use\n\nActivity Log is very easy to use. A trait named **_ActivityLogHandler_** is to be added to any model to activate logging. On the other hand log can be enabled manually by initiating **_Logging_** class. Auto logging system can be added as like bellow,\n\n~~~php\nnamespace App;\n\nuse Illuminate\\Database\\Eloquent\\Model;\nuse Amsrafid\\ActivityLog\\Traits\\ActivityLogHandler;\n\nclass MyModel extends Model\n{\n    use ActivityLogHandler;\n\n    // Optionals\n    protected $log_name = \"Log name\";\n\n    protected $description = \"Log description\";\n\n    protected $ignore_fields = [\n        // if any fields that being ignored to be logged\n    ];\n\n    protected $ignore_log = [\n        // if any logging mode is to be ignored in (insert, update, delete, forceDelete)\n    ];\n}\n~~~\n\nManual logging system is added bellow,\n\n~~~php\n$myModel = MyModel::find(1);\n$myModel-\u003edata = 'value';\n$log = new Logging($myModel, 'update'); // model instance, mode -\u003e [insert, update, delete, forceDelete]\n$log-\u003estart();\n~~~\nOR\n~~~php\n// Insertion operation\n$myModel = new MyModel;\n$myModel-\u003edata = 'value';\n$myModel-\u003esave();\n\n// Create new Activity Log\n$log = new Logging(MyModel::class, 'insert');   // model name, mode -\u003e [insert, update, delete, forceDelete]\n$log-\u003eproperty([\n    'new' =\u003e $myModel-\u003etoArray()\n]);\n$log-\u003elogName('Save my model');\n$log-\u003edescription('My model log has been created manually.');\n$log-\u003eprimaryId($myModel-\u003eid);\n$log-\u003estart();\n~~~\n\nHere, Property can set by using `setProperty(array new, array old)` method. Where, 2 arguments can be performed to set new and old property of model. Here, default is an empty array for both.\n\n_Note: Clear configuration cache to active configuration file. Otherwise, log may not be created._\n\n## Barrier\n\nLogging can be paused at any time and to be proceed by using `paused` and `proceed` static method respectively.\n\n~~~php\n$myModel = new MyModel;\n$myModel-\u003edata = 'value 1'; // Log created\n$myModel-\u003esave();\n\nLogging::paused();  // Logging become paused\n\n$myModel-\u003edata = 'value 2'; // Log not created\n$myModel-\u003esave();\n\nLogging::proceed(); // Logging proceed again\n\n$myModel-\u003edata = 'value 3'; // Log created\n$myModel-\u003esave();\n~~~\n\n_Note: Log barrier can be checked by `isPaused` static method._\n\n## Parsing of log\n\nLog can be parsed by using `\\Amsrafid\\ActivityLog\\Models\\ActivityLog\\ActivityLog::class` that extends with `\\Illuminate\\Database\\Eloquent\\Model`. So, ActivityLog::class acts same as a regular model. Here, `properties` property returns an `array` to better use.\n\n~~~php\n$set = ActivityLog::latest()-\u003efirst();\n\necho $set-\u003eproperties['new']['description'];\n~~~\n\n## Log cleaning up\n\nLog can be deleted when a lot of activity has been recorded. To solve this problem, custom artisan command `clear:log` can help. It can operate when run the command bellow to the command window,\n\n~~~php\nphp artisan clear:log\n~~~\nOR\n~~~php\nphp artisan clear:log --day=7\n~~~\nOR\n~~~php\nphp artisan clear:log --date=2021-03-19\n~~~\n\nHere, option `--date` denotes the date before log will be deleted and `--day` to the number of day(s) before log will be cleared. Option _**day**_ will not be applicable when _**date**_ is given.\n\nTo operate cleaning automatically, a schedule can be created to console Kernel like bellow,\n\n~~~php\n// ~/app/Console/Kernel.php\n\nprotected function schedule(Schedule $schedule)\n{\n   $schedule-\u003ecommand('clear:log')-\u003edaily();\n}\n~~~\n\n*Note: Data will be deleted the day(s) before the value of the key `clean_log_before_days` given into config file when `--date` or `--day` option is not given.*\n\n## Authors\n\n_Initial development_ - **_A. M. Sadman Rafid_**\n\n## Security Vulnerabilities\n\nIf you discover a security vulnerability within Laravel Activity Log, please send an e-mail to _A. M. Sadman Rafid_ via [amsrafid@gmail.com](mailto:amsrafid@gmail.com). All security vulnerabilities will be promptly addressed.\n\n## License\n\nThe Laravel Activity Log is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famsrafid%2Flaravel-activitylog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famsrafid%2Flaravel-activitylog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famsrafid%2Flaravel-activitylog/lists"}