Spatie\Activitylog\Traits\LogsActivity::shouldLogEvent PHP Method

shouldLogEvent() protected method

protected shouldLogEvent ( string $eventName ) : boolean
$eventName string
return boolean
    protected function shouldLogEvent(string $eventName) : bool
    {
        if (!in_array($eventName, ['created', 'updated'])) {
            return true;
        }
        if (array_has($this->getDirty(), 'deleted_at')) {
            if ($this->getDirty()['deleted_at'] === null) {
                return false;
            }
        }
        //do not log update event if only ignored attributes are changed
        return (bool) count(array_except($this->getDirty(), $this->attributesToBeIgnored()));
    }