motwreen / laravel-socialmedia
A laravel adapter for social media networks
dev-master
2018-01-31 17:22 UTC
Requires
- abraham/twitteroauth: ^0.6.4
- dirkgroenen/pinterest-api-php: ^0.2.11
- facebook/graph-sdk: ^5.0
Requires (Dev)
- guzzlehttp/guzzle: ~6.0
- orchestra/testbench: ~3.2
- phpunit/phpunit: ^5.4
- vlucas/phpdotenv: ^2.3
This package is not auto-updated.
Last update: 2020-01-10 16:56:47 UTC
README
#laravel-socialmedia
The first step will be to implement a post function for each Driver .
Install
composer require "motwreen/laravel-socialmedia":"@dev"
'providers' = [
...
Motwreen\Socialmedia\Providers\SocialmediaServiceProvider::class
],
'aliases' = [
...
'Socialmedia' => Motwreen\Socialmedia\Facades\Socialmedia::class
]
Usage
$config = [
'app_id' => 'FACEBOOK_APP_ID',
'app_secret' => 'FACEBOOK_APP_SECRET',
'access_token' => 'FACEBOOK_APP_ACCESS_TOKEN',
];
$post=['message'=>'Awesome POST Test message'];
Socialmedia::driver('facebook')->setConfig($config)->post($params);
Drivers
Obtain permanent Access Token: http://stackoverflow.com/a/28418469
Obtain permanent Access Token: https://dev.twitter.com/oauth/overview/application-owner-access-tokens
How to get an access token:
- Create Developer Account here
- Create App and get app_id & app_secret from app details page
- Issue new token