Package Data | |
---|---|
Maintainer Username: | HighSolutions |
Maintainer Contact: | adam@highsolutions.pl (HighSolutions) |
Package Create Date: | 2017-06-28 |
Package Last Update: | 2020-09-09 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-16 15:00:30 |
Package Statistics | |
---|---|
Total Downloads: | 86 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 3 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Easy creation of Slack notifications about posts published on subscribed Facebook's fanpages.
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.
| 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.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',
],
// ...
],
],
],
// ...
];
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
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.
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.0
This package is developed by HighSolutions, software house from Poland in love in Laravel.