-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to extends functionality of any provider? #100
Comments
Hey! I didn't understand nothing, can you clarify what are you trying to reach and where is a problem Thanks |
Code are all right I need to add some methods on Provider Twitter class so that it can upload image and make a tweet. |
I highly recommend creating an external class called service and don't try to create a provider that extends twitter one Example <?php
use SocialConnect\OAuth1\AccessToken;
use SocialConnect\OAuth1\Provider\Twitter;
class TwitterService
{
/**
* @var Twitter
*/
protected $twitter;
/**
* MyAwesomeServiceThatWorksWithTwitter constructor.
* @param Twitter $twitter
*/
public function __construct(Twitter $twitter)
{
$this->twitter = $twitter;
}
public function doSomething(AccessToken $token)
{
$this->twitter->request('POST', '/upload', [], $token, [
'image' => 'heh'
]);
}
} All provider has public |
I am going close this issue because example was provided above and no replies Thanks |
I am very new with I success full login with any provide.
but twitter image upload use different api.
I want to extend functionality of Twitter provider class with my custom one without change core file.
if I update SocialConnect/auth feature maybe I lost my customization.
I need help on this.
Thank You.
Great PHP LIB SocialConnect/auth
The text was updated successfully, but these errors were encountered: