jublo / codebird-php

Easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.
https://www.jublo.net/projects/codebird/php
GNU General Public License v3.0
776 stars 234 forks source link

Trying to get property of non object on valid stdClass #211

Closed afariasfermin closed 5 years ago

afariasfermin commented 7 years ago

i have the following code

$feeds = $this->token()->tw->statuses_userTimeline(["count" => 25, "exclude_replies" => true]);

return (array) $feeds;

when a i try to do somthing like

@foreach($tweets as $tweet)
    {{dump($tweet->text)}}
@endforeach

i got

Fatal Error

Trying to get property of non-object

and if i do somthing like

@foreach($tweets as $tweet)
    {{dump($tweet['text'])}}
@endforeach

this is what happens instead

Fatal Error

Cannot use object of type stdClass as array

mynetx commented 6 years ago

@piryguiry What does this code show instead?

@foreach($tweets as $tweet)
    {{dump($tweet)}}
    {{dump(gettype($tweet))}}
@endforeach

Also, which template engine is this?

afariasfermin commented 6 years ago

@mynetx I can't understand what was happening, so i just ended used the twitteroauth library instead. the template engine was blade.