{"id":15502938,"url":"https://github.com/dmyers/laravel-webhooks","last_synced_at":"2025-07-16T02:40:27.578Z","repository":{"id":28181219,"uuid":"31682786","full_name":"dmyers/laravel-webhooks","owner":"dmyers","description":"A simple webhooks/pubsub package for Laravel.","archived":false,"fork":false,"pushed_at":"2015-03-04T22:16:20.000Z","size":108,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T17:30:01.331Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmyers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-04T22:15:09.000Z","updated_at":"2021-10-11T01:28:38.000Z","dependencies_parsed_at":"2022-09-06T04:02:40.299Z","dependency_job_id":null,"html_url":"https://github.com/dmyers/laravel-webhooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmyers%2Flaravel-webhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmyers%2Flaravel-webhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmyers%2Flaravel-webhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmyers%2Flaravel-webhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmyers","download_url":"https://codeload.github.com/dmyers/laravel-webhooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246077521,"owners_count":20720010,"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-10-02T09:11:37.866Z","updated_at":"2025-03-28T18:23:21.625Z","avatar_url":"https://github.com/dmyers.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webhooks Package for Laravel 4\n\nWebhooks is a pubsub/pubsubhubbub system for Laravel 4 applications.\n\n## Installation via Composer\n\nAdd this to you composer.json file, in the require object:\n\n```javascript\n\"dmyers/laravel-webhooks\": \"dev-master\"\n```\n\nAfter that, run composer install to install Webhooks.\n\nAdd the service provider to `app/config/app.php`, within the `providers` array.\n\n```php\n'providers' =\u003e array(\n    // ...\n    'Dmyers\\Webhooks\\WebhooksServiceProvider',\n)\n```\n\nAdd a class alias to `app/config/app.php`, within the `aliases` array.\n\n```php\n'aliases' =\u003e array(\n    // ...\n    'Webhooks' =\u003e 'Dmyers\\Webhooks\\Webhooks',\n)\n```\n\nPublish the package's model, migration, and view.\n\n```console\nphp artisan model:publish dmyers/laravel-webhooks\nphp artisan migration:publish dmyers/laravel-webhooks\n```\n\nAdd the trait to the model you want to act as subscribers on.\n\n```php\nuse Subscribable;\n```\n\nFinally, add the trait to the models you want to publish events on.\n\n```php\nuse Eventable;\n\nprotected static $eventable = [\n\t'created' =\u003e 'object.create',\n\t'updated' =\u003e 'object.updated',\n\t'deleted' =\u003e 'object.delete',\n];\n\nprotected $eventable_sync = ['id', 'subject'];\n```\n\n## Usage\n\nFirst get an instance of an item type (model):\n\n```php\n$object = Model::find(1);\n```\n\nFetch all the activity:\n\n```php\n$object-\u003eactivity(array(\n\t'id'        =\u003e $activity_id, // optional\n\t'doer_id'   =\u003e $doer_id, // optional\n\t'victim_id' =\u003e $victim_id, // optional\n\t'item_id'   =\u003e $item_id, // optional\n\t'item_type' =\u003e $item_type, // optional\n\t'feed_type' =\u003e $feed_type, // optional\n));\n```\n\nTrack an activity event:\n\n```php\n$object-\u003eaddActivity($item_type, $doer_id, $victim_id, $action);\n```\n\nUpdate an activity event:\n\n```php\n$object-\u003eupdateActivity($item_type, $doer_id, $victim_id, $action);\n```\n\nDelete an activity event:\n\n```php\n$object-\u003edeleteActivity($item_type, $doer_id, $victim_id, $action);\n```\n\nDisplay an activity feed:\n\n```php\n$object-\u003erenderActivityFeed($type, $doer_id, $victim_id);\n```\n\nPush a feed into another activity feed:\n\n```php\n$object-\u003epushActivityFeed($type, $doer_id, $victim_id);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmyers%2Flaravel-webhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmyers%2Flaravel-webhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmyers%2Flaravel-webhooks/lists"}