{"id":18486187,"url":"https://github.com/mathsgod/r-db-eventlog","last_synced_at":"2025-05-13T22:13:17.236Z","repository":{"id":61392608,"uuid":"551223309","full_name":"mathsgod/r-db-eventlog","owner":"mathsgod","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-14T03:08:59.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T09:03:25.033Z","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/mathsgod.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":"2022-10-14T03:00:49.000Z","updated_at":"2022-10-14T03:01:03.000Z","dependencies_parsed_at":"2022-10-16T19:14:34.995Z","dependency_job_id":null,"html_url":"https://github.com/mathsgod/r-db-eventlog","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/mathsgod%2Fr-db-eventlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fr-db-eventlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fr-db-eventlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fr-db-eventlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathsgod","download_url":"https://codeload.github.com/mathsgod/r-db-eventlog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036843,"owners_count":22003654,"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-11-06T12:48:15.673Z","updated_at":"2025-05-13T22:13:12.229Z","avatar_url":"https://github.com/mathsgod.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# r-db-eventlog\n\nAuto generated event log when a database record is created, inserted and deleted.\n\n## setup\nCreate database table EventLog\n\n```sql\nCREATE TABLE `EventLog` (\n  `eventlog_id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `class` varchar(64) DEFAULT NULL,\n  `id` int(10) unsigned NOT NULL,\n  `action` varchar(64) DEFAULT NULL,\n  `source` json DEFAULT NULL,\n  `target` json DEFAULT NULL,\n  `remark` text,\n  `user_id` int(10) unsigned NOT NULL,\n  `created_time` datetime NOT NULL,\n  `status` int(10) unsigned DEFAULT '0',\n  `different` json DEFAULT NULL,\n  PRIMARY KEY (`eventlog_id`),\n  KEY `class` (`class`),\n  KEY `user_id` (`user_id`),\n  KEY `id` (`id`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;\n```\n\nRegister listeners\n\n```php\n$schema = \\R\\DB\\Model::GetSchema();\n\n$subscriber = new ListenerSubscriber();\n\n$subscriber-\u003esetUserId(1);\n\n$schema-\u003eeventDispatcher()-\u003esubscribeListenersFrom($subscriber);\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Fr-db-eventlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathsgod%2Fr-db-eventlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Fr-db-eventlog/lists"}