{"id":20696077,"url":"https://github.com/laravel-notification-channels/facebook-poster","last_synced_at":"2025-04-04T22:09:19.191Z","repository":{"id":37617176,"uuid":"73361533","full_name":"laravel-notification-channels/facebook-poster","owner":"laravel-notification-channels","description":"Use notifications to create posts on Facebook","archived":false,"fork":false,"pushed_at":"2024-03-12T05:36:28.000Z","size":98,"stargazers_count":134,"open_issues_count":0,"forks_count":28,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-04-13T20:21:47.909Z","etag":null,"topics":["facebook","laravel-notification-channels"],"latest_commit_sha":null,"homepage":"http://laravel-notification-channels.com","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/laravel-notification-channels.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-10T08:26:05.000Z","updated_at":"2024-06-18T22:46:28.957Z","dependencies_parsed_at":"2023-12-18T03:23:17.690Z","dependency_job_id":"dd09192e-a224-406a-9572-d91043c769e7","html_url":"https://github.com/laravel-notification-channels/facebook-poster","commit_stats":{"total_commits":103,"total_committers":10,"mean_commits":10.3,"dds":"0.35922330097087374","last_synced_commit":"46507c45d0a4116955f1c32418a523e8b4bd99f9"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravel-notification-channels%2Ffacebook-poster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravel-notification-channels%2Ffacebook-poster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravel-notification-channels%2Ffacebook-poster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laravel-notification-channels%2Ffacebook-poster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laravel-notification-channels","download_url":"https://codeload.github.com/laravel-notification-channels/facebook-poster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256115,"owners_count":20909240,"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":["facebook","laravel-notification-channels"],"created_at":"2024-11-17T00:12:28.012Z","updated_at":"2025-04-04T22:09:19.173Z","avatar_url":"https://github.com/laravel-notification-channels.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FacebookPoster Notification Channel For Laravel\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-notification-channels/facebook-poster.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/facebook-poster)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n![Build Status](https://github.com/laravel-notification-channels/facebook-poster/workflows/test/badge.svg)\n[![StyleCI](https://styleci.io/repos/73361533/shield)](https://styleci.io/repos/73361533)\n[![Total Downloads](https://img.shields.io/packagist/dt/laravel-notification-channels/facebook-poster.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/facebook-poster)\n\nThis package makes it easy to post to Facebook using Laravel notification channels.\n\n## Contents\n\n- [Installation](#installation)\n- [Setting up the Facebook posts service](#setting-up-the-facebook-poster-service)\n- [Usage](#usage)\n  - [Publish Facebook post](#publish-facebook-post)\n  - [Publish Facebook post with link](#publish-facebook-post-with-link)\n- [Changelog](#changelog)\n- [Testing](#testing)\n- [Security](#security)\n- [Contributing](#contributing)\n- [Credits](#credits)\n- [License](#license)\n\n## Installation\n\nYou can install this package via Composer:\n\n```bash\ncomposer require laravel-notification-channels/facebook-poster\n```\n\n### Configuration\n\nYou'll need to get the Facebook Page ID as well as a page access token with the `pages_read_engagement` and `pages_manage_post` permissions. You will need to go through App Review in order to use these permissions. Then, add the configuration to your `config/services.php` file:\n\n```php\n...\n'facebook_poster' =\u003e [\n    'page_id' =\u003e env('FACEBOOK_PAGE_ID'),\n    'access_token' =\u003e env('FACEBOOK_ACCESS_TOKEN'),\n],\n```\n\n## Usage\n\nFollow Laravel's [documentation](https://laravel.com/docs/master/notifications) to add the channel to your Notification class.\n\n### Publish Facebook post\n\n```php\nuse NotificationChannels\\FacebookPoster\\FacebookPosterChannel;\nuse NotificationChannels\\FacebookPoster\\FacebookPosterPost;\n\nclass NewsWasPublished extends Notification\n{\n\n    /**\n     * Get the notification's delivery channels.\n     *\n     * @param  mixed  $notifiable\n     * @return array\n     */\n    public function via($notifiable)\n    {\n        return [FacebookPosterChannel::class];\n    }\n\n    /**\n     * Get the Facebook post representation of the notification.\n     *\n     * @param  mixed  $notifiable.\n     * @return \\NotificationChannels\\FacebookPoster\\FacebookPosterPost\n     */\n    public function toFacebookPoster($notifiable) {\n        return new FacebookPosterPost('Laravel notifications are awesome!');\n    }\n}\n```\n\n### Publish Facebook post with link\n\nIt is possible to publish link with your post too. You just have to pass the URL to the `withLink` method.\n\n```php\npublic function toFacebookPoster($notifiable) {\n    return (new FacebookPosterPost('Laravel notifications are awesome!'))\n        -\u003ewithLink('https://laravel.com');\n}\n```\n\n### Publish Facebook post with custom configuration\n\nYou can implement `routeNotificationForFacebookPoster()` on your notifiable class in order to provide custom configuration.\n\n```php\npublic function routeNotificationForFacebookPoster(): array\n{\n    return [\n        'page_id' =\u003e 'customPageId',\n        'access_token' =\u003e 'customAccessToken',\n    ];\n}\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\n```bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Credits\n\n- [Ahmed Ashraf](https://github.com/ahmedash95)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaravel-notification-channels%2Ffacebook-poster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaravel-notification-channels%2Ffacebook-poster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaravel-notification-channels%2Ffacebook-poster/lists"}