tv2regionerne/statamic-events
最新稳定版本:v2.0.0
Composer 安装命令:
composer require tv2regionerne/statamic-events
包简介
README 文档
README
Statamic Events is a Statamic addon that lets you run actions when events are triggered.
How to Install
Run the following command from your project root:
composer require tv2regionerne/statamic-events
Configuration
A configuration file can be published by running the following command:
php artisan vendor:publish --tag=statamic-events
This will create statamic-events in your config folder.
Extra events
By default this add-on will list events in the Statamic\Events namespace, but you can change this or configure other events to be listed by modifying the statamic-events.events config. This should be a list of folders relative to the base folder, keyed by their namespace.
After changing this config, you should run php artisan cache:clear.
Response handlers
Each driver allows you to specify response_handlers which can be used to run any additional processing. This should be an array of unique keys to fully qualified class names, eg ['my_key' => '\App\Handlers\MyHandler::class']
A handler is a class containing a handle method:
class MyHandler { public function handle(array $config, string $eventName, mixed $event, mixed $response = null) { // run some logic // you may want to $execution->log(string $message, array $data) something } }
API
This add-on integrates with the Private API addon to provide an end point for managing handlers. The following endpoints are available:
Viewing all handlers:
GET {base}/statamic-events/handlers
View an individual handler:
GET {base}/statamic-events/handlers/{id}
Add a new handler:
POST {base}/statamic-events/handlers
Update an individual handler:
PATCH {base}/statamic-events/handlers/{id}
Delete a handler
DELETE {base}/statamic-events/handlers/{id}
统计信息
- 总下载量: 91
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-09-25