Skip to content
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

Trying to get property of non-object #21

Open
wutmikee opened this issue Dec 12, 2015 · 1 comment
Open

Trying to get property of non-object #21

wutmikee opened this issue Dec 12, 2015 · 1 comment

Comments

@wutmikee
Copy link

First off, I'm using your 2.1 branch (as I'm using Laravel 5.1). However, I'm getting the error mentioned in my title...with:

protected function responseOk()
{
    // THIS IS RETURNING FALSE
    return $this->response ? $this->response->httpstatus == 200 : false;
}

I'm simply calling this function in controller:

use Twitter;

public function authorizeUser()
{
    return Twitter::authorize();
}

Route:

Route::get('oauth/twitter/authorize', ['as' => 'twitter.authorize', 'uses' => 'TwitterOAuthController@authorizeUser']); 

View:

<a class="tiny button right" href="{{ route('twitter.authorize') }}">Connect Twitter Account</a>

Any ideas why? Can't seem to figure it out. Or am I approaching this all wrong?

@m3ikoviki
Copy link

I'm not sure of it, but Twitter API do return Arrays for some end points and objects for others.
I edited the line #230 in Twitter class to add (object) :

return (object)$this->reformatResult($result);

and problem solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants