private function insertPublishment($type, $publication, $content)
{
if ($this->publishment->double($content)->exists()) {
$publishment = $this->publishment->double($content)->first();
} else {
$publishment = new Publishment();
}
$publishment->user_id = Auth::user()->id;
$publishment->content = $content;
if ($type == self::TYPE_TWITTER) {
$publishment->tweet_id = $publication['id_str'];
$publishment->post_date = changeDateFormat($publication['created_at']);
} else {
if ($type == self::TYPE_FACEBOOK) {
$publishment->fb_post_id = $publication->id;
$publishment->post_date = Carbon::now();
}
}
$publishment->save();
}