attributes['user_id'] = Auth::id(); } public function add($targetId = 0, $targetField = '') { $this->attributes['user_id'] = Auth::id(); $this->attributes['target_id'] = $targetId; $this->attributes['target_field'] = $targetField; return $this->save(); } }