/** * Log activity in an Eloquent model. * * @param string $text * @param $userId * @param array $attributes * * @return bool */ public function log($action, $name, $type, $userId = '', $attributes = []) { Activity::create(['action' => $action, 'name' => $name, 'type' => $type, 'user_id' => $userId == '' ? null : $userId, 'ip_address' => $attributes['ipAddress']]); return true; }
/** * Log activity in an Eloquent model. * * @param string $text * @param $userId * @param array $attributes * * @return bool */ public function log($text, $userId = '', $attributes = []) { Activity::create(['text' => $text, 'user_id' => $userId == '' ? null : $userId, 'ip_address' => $attributes['ipAddress']]); return true; }
/** * Log activity in an Eloquent model. * * @param string $text * @param $userId * @param array $attributes * * @return bool */ public function log($text, $userId = '', $attributes = []) { Activity::create(['text' => $text, 'user_id' => $userId == '' ? null : $userId, 'model_id' => isset($attributes['model_id']) ? $attributes['model_id'] : null, 'data_id' => isset($attributes['data_id']) ? $attributes['data_id'] : null, 'ip_address' => $attributes['ipAddress']]); return true; }