Facebook son paylaşımları yaptırmaya çalışıyorum.Elimde şöyle bir kod var
protected function updateFacebookPosts()
{
$user = Sentry::getUser();
if(in_array('facebook_access_token', ($user->settings->lists('setting')))) {
FacebookSession::setDefaultApplication(Config::get('oauth.facebook_client_id'), Config::get('oauth.facebook_client_secret'));
$session = new FacebookSession(UserSetting::where('user_id', $user->id)->where('setting', 'facebook_access_token')->first()->value);
$user_posts = (new FacebookRequest(
$session, 'GET', '/me/statuses?limit=10'
))->execute()->getGraphObject()->asArray();
$user->facebookPosts()->delete();
foreach ($user_posts['data'] as $post) {
$socialPost = new SocialPost();
$socialPost->post_id = $post->id;
$socialPost->type = 'facebook';
$socialPost->content = $post->message;
$socialPost->posted_on = date('Y-m-d H:i:s', strtotime(str_replace('-', '/', $post->updated_time)));
$socialPost->user()->associate($user);
$socialPost->save();
}
return true;
}
else
{
return Redirect::route('flogin');
}
}
fakat
Undefined property: stdClass::$message su hatayı almaktayım
$socialPost->content = $post->message; şu kısmı kaldırınca tarihi sorunsuz ekliyor fakat yazıyla ilgili hiç ekleme olmuyor.ne yapmam lazım