[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8317":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":15,"starSnapshotCount":15,"syncStatus":18,"lastSyncTime":32,"discoverSource":33},8317,"laravel-activitylog","spatie\u002Flaravel-activitylog","spatie","Log activity inside your Laravel app","https:\u002F\u002Fdocs.spatie.be\u002Flaravel-activitylog",null,"PHP",5847,744,89,0,4,20,2,39.62,"MIT License",false,"main",[24,25,26,27,28],"audit","laravel","log","monitoring","php","2026-06-12 02:01:52","\u003Cdiv align=\"left\">\n    \u003Ca href=\"https:\u002F\u002Fspatie.be\u002Fopen-source?utm_source=github&utm_medium=banner&utm_campaign=laravel-activitylog\">\n      \u003Cpicture>\n        \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fspatie.be\u002Fpackages\u002Fheader\u002Flaravel-activitylog\u002Fhtml\u002Fdark.webp\">\n        \u003Cimg alt=\"Logo for laravel-activitylog\" src=\"https:\u002F\u002Fspatie.be\u002Fpackages\u002Fheader\u002Flaravel-activitylog\u002Fhtml\u002Flight.webp\">\n      \u003C\u002Fpicture>\n    \u003C\u002Fa>\n\n\u003Ch1>Log activity inside your Laravel app\u003C\u002Fh1>\n\n[![Latest Version on Packagist](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fv\u002Fspatie\u002Flaravel-activitylog.svg?style=flat-square)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fspatie\u002Flaravel-activitylog)\n[![GitHub Workflow Status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fspatie\u002Flaravel-activitylog\u002Frun-tests.yml?branch=main&label=Tests)](https:\u002F\u002Fgithub.com\u002Fspatie\u002Flaravel-activitylog\u002Factions\u002Fworkflows\u002Frun-tests.yml)\n[![Check & fix styling](https:\u002F\u002Fgithub.com\u002Fspatie\u002Flaravel-activitylog\u002Fworkflows\u002FCheck%20&%20fix%20styling\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fspatie\u002Flaravel-activitylog\u002Factions\u002Fworkflows\u002Fphp-cs-fixer.yml)\n[![Total Downloads](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fdt\u002Fspatie\u002Flaravel-activitylog.svg?style=flat-square)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fspatie\u002Flaravel-activitylog)\n    \n\u003C\u002Fdiv>\n\nThe `spatie\u002Flaravel-activitylog` package provides easy to use functions to log the activities of the users of your app. It can also automatically log model events.\nThe package stores all activity in the `activity_log` table.\n\nHere's a demo of how you can use it:\n\n```php\nactivity()->log('Look, I logged something');\n```\n\nYou can retrieve all activity using the `Spatie\\Activitylog\\Models\\Activity` model.\n\n```php\nActivity::all();\n```\n\nHere's a more advanced example:\n\n```php\nactivity()\n   ->performedOn($anEloquentModel)\n   ->causedBy($user)\n   ->withProperties(['customProperty' => 'customValue'])\n   ->log('Look, I logged something');\n\n$lastLoggedActivity = Activity::all()->last();\n\n$lastLoggedActivity->subject; \u002F\u002Freturns an instance of an eloquent model\n$lastLoggedActivity->causer; \u002F\u002Freturns an instance of your user model\n$lastLoggedActivity->getProperty('customProperty'); \u002F\u002Freturns 'customValue'\n$lastLoggedActivity->description; \u002F\u002Freturns 'Look, I logged something'\n```\n\nHere's an example on [event logging](https:\u002F\u002Fspatie.be\u002Fdocs\u002Flaravel-activitylog\u002Fadvanced-usage\u002Flogging-model-events).\n\n```php\n$newsItem->name = 'updated name';\n$newsItem->save();\n\n\u002F\u002Fupdating the newsItem will cause the logging of an activity\n$activity = Activity::all()->last();\n\n$activity->description; \u002F\u002Freturns 'updated'\n$activity->subject; \u002F\u002Freturns the instance of NewsItem that was saved\n```\n\nCalling `$activity->attribute_changes` will return this collection:\n\n```php\n[\n   'attributes' => [\n        'name' => 'updated name',\n        'text' => 'Lorem',\n    ],\n    'old' => [\n        'name' => 'original name',\n        'text' => 'Lorem',\n    ],\n];\n```\n\n## Support us\n\n[\u003Cimg src=\"https:\u002F\u002Fgithub-ads.s3.eu-central-1.amazonaws.com\u002Flaravel-activitylog.jpg?t=1\" width=\"419px\" \u002F>](https:\u002F\u002Fspatie.be\u002Fgithub-ad-click\u002Flaravel-activitylog)\n\nWe invest a lot of resources into creating [best in class open source packages](https:\u002F\u002Fspatie.be\u002Fopen-source). You can support us by [buying one of our paid products](https:\u002F\u002Fspatie.be\u002Fopen-source\u002Fsupport-us).\n\nWe highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https:\u002F\u002Fspatie.be\u002Fabout-us). We publish all received postcards on [our virtual postcard wall](https:\u002F\u002Fspatie.be\u002Fopen-source\u002Fpostcards).\n\n## Documentation\n\nYou'll find the documentation on [https:\u002F\u002Fspatie.be\u002Fdocs\u002Flaravel-activitylog\u002Fintroduction](https:\u002F\u002Fspatie.be\u002Fdocs\u002Flaravel-activitylog\u002Fintroduction).\n\nFind yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving the activity log? Feel free to [create an issue on GitHub](https:\u002F\u002Fgithub.com\u002Fspatie\u002Flaravel-activitylog\u002Fissues), we'll try to address it as soon as possible.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require spatie\u002Flaravel-activitylog\n```\n\nThe package will automatically register itself.\n\nYou can publish the migration with:\n\n```bash\nphp artisan vendor:publish --provider=\"Spatie\\Activitylog\\ActivitylogServiceProvider\" --tag=\"activitylog-migrations\"\n```\n\n_Note_: The default migration assumes you are using integers for your model IDs. If you are using UUIDs, or some other format, adjust the format of the `subject_id` and `causer_id` fields in the published migration before continuing.\n\nAfter publishing the migration you can create the `activity_log` table by running the migrations:\n\n```bash\nphp artisan migrate\n```\n\nYou can optionally publish the config file with:\n\n```bash\nphp artisan vendor:publish --provider=\"Spatie\\Activitylog\\ActivitylogServiceProvider\" --tag=\"activitylog-config\"\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information about recent changes.\n\n## Upgrading\n\nPlease see [UPGRADING](UPGRADING.md) for details.\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](https:\u002F\u002Fgithub.com\u002Fspatie\u002F.github\u002Fblob\u002Fmain\u002FCONTRIBUTING.md) for details.\n\n## Security\n\nIf you've found a bug regarding security please mail [security@spatie.be](mailto:security@spatie.be) instead of using the issue tracker.\n\n## Credits\n\n-   [Freek Van der Herten](https:\u002F\u002Fgithub.com\u002Ffreekmurze)\n-   [Sebastian De Deyne](https:\u002F\u002Fgithub.com\u002Fsebastiandedeyne)\n-   [Tom Witkowski](https:\u002F\u002Fgithub.com\u002FGummibeer)\n-   [All Contributors](..\u002F..\u002Fcontributors)\n\nSpecial thanks to [Ahmed Nagi](https:\u002F\u002Fgithub.com\u002Fnagi1) for all the work he put in `v4` and to [Caneco](https:\u002F\u002Ftwitter.com\u002Fcaneco) for the original logo.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","`spatie\u002Flaravel-activitylog` 是一个用于在 Laravel 应用中记录用户活动的日志工具。其核心功能包括简便地记录用户操作和自动记录模型事件，并将所有活动日志存储于 `activity_log` 表中，支持自定义属性的添加以丰富日志信息。该包还提供了灵活的查询接口，方便开发者获取和分析日志数据。适用于需要对系统内用户行为进行审计、监控或故障排查的应用场景，如企业级应用开发、在线交易平台等，能够帮助开发者更好地理解和追踪应用内的用户活动。","2026-06-11 03:17:19","top_language"]