highsolutions/laravel-poster
Composer 安装命令:
composer require highsolutions/laravel-poster
包简介
A Laravel package for easy Slack notifications about posts published on subscribed Facebook's fanpages.
README 文档
README
Easy creation of Slack notifications about posts published on subscribed Facebook's fanpages.
Installation
Add the following line to the require section of your Laravel webapp's composer.json file:
"require": { "highsolutions/laravel-poster": "1.*" }
Run composer update to install the package.
This package uses Laravel 5.5 Package Auto-Discovery.
For previous versions of Laravel, you need to update config/app.php by adding an entry for the service provider:
'providers' => [ // ... HighSolutions\Poster\PosterServiceProvider::class, ];
Next, publish all package resources:
php artisan vendor:publish --provider="HighSolutions\Poster\PosterServiceProvider"
This will add to your project:
- migration - database table for storing posts and tokens
- configuration - package configurations
- views - configurable views for token refreshing
Remember to launch migration:
php artisan migrate
Next step is to add cron task via Scheduler (app\Console\Kernel.php):
protected function schedule(Schedule $schedule) { // ... $schedule->command('poster:fetch')->hourly(); }
Remember to assign cron tasks to artisan.
Configuration
| Setting name | Description | Default value |
|---|---|---|
| socials.facebook.credentials.app_id | Facebook's app identifier | '' |
| socials.facebook.credentials.app_secret | Facebook's app secret | '' |
| socials.facebook.api_version | Graph API version | 'v5.0' |
| socials.facebook.list | List of Facebook pages | [] |
| slack.default_channel | Default channel for notifications | '' |
| slack.webhook_url | Slack's webhook url | '' |
Facebook lists are defined like:
<?php return [ 'socials' => [ 'facebook' => [ 'credentials' => [ // ... ], 'list' => [ 'highsolutions' => [ 'name' => 'HighSolutions daily', 'channel' => '#general', ], // ... ], ], ], // ... ];
Facebook app
You need to provide Facebook's app id and secret. Moreover, you have to define redirect url for your application.
E.g. http://yourdomain.com/laravel-poster/fb_get/obtained
Facebook Access Token
To fetch Facebook page's posts you need Facebook Access Token. Any Facebook user can use his account to store Access Token. It's valid for 2 months.
When Access Token is going to expire, any user has to click on provided link and connect with Facebook via link on website. The same operation is needed for first time.
For now there is no way to make it fully automatic. Thanks to Facebook.
Changelog
1.3.0
- Support Laravel 7.x and 8.x
1.2.2
- Set up Graph API version
1.2.1
- Common style of hyperlinks
1.2.0
- Styling facebook button according to brandbook
1.1.0
- Support Laravel 6.0
1.0.7
- Debug information about wrong JSON was fired when JSON was valid
1.0.6
- Handle problem when post is share of another post
1.0.5
- Support Package Auto-Discovery
1.0.4
- Fix timezone problems
1.0.3
- Little fixes on readme
- Check if SocialToken->notified_at is null
1.0.0
- Create package
- Slack support
- Facebook posts support
Roadmap
- Not only Facebook fanpages support.
- Not only Slack notifications support.
- Trigger events
- Comments
- Unit tests!
Credits
This package is developed by HighSolutions, software house from Poland in love in Laravel.
highsolutions/laravel-poster 适用场景与选型建议
highsolutions/laravel-poster 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 88 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 07 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「notifications」 「facebook」 「laravel」 「posts」 「wall」 「slack」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 highsolutions/laravel-poster 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 highsolutions/laravel-poster 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 highsolutions/laravel-poster 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova package that adds a notification feed in your Nova app.
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
Contao 4 bundle for a Facebook login.
Captures outgoing SMS notifications
Alfabank REST API integration
统计信息
- 总下载量: 88
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-05
