Spatie\Activitylog\ActivityLogger::log PHP Method

log() public method

public log ( string $description ) : null | mixed
$description string
return null | mixed
    public function log(string $description)
    {
        if (!$this->logEnabled) {
            return;
        }
        $activity = ActivitylogServiceProvider::getActivityModelInstance();
        if ($this->performedOn) {
            $activity->subject()->associate($this->performedOn);
        }
        if ($this->causedBy) {
            $activity->causer()->associate($this->causedBy);
        }
        $activity->properties = $this->properties;
        $activity->description = $this->replacePlaceholders($description, $activity);
        $activity->log_name = $this->logName;
        $activity->save();
        return $activity;
    }