trait LogsActivity

LogsActivity model trait

* In the model class definition:

use \Igniter\Flame\Database\Traits\LogsActivity;

You can log the changed attributes for all these events : protected static $logAttributes = ['name', 'text'];

You can customize the events being logged : protected static $recordEvents = ['deleted'];

You can customize the description : public function getMessageForEvent(string $eventName) { return "This model has been {$eventName}"; };

You can ignore changes to certain attributes : protected static $ignoreChangedAttributes = ['text'];

You can log only the changed attributes : protected static $logOnlyDirty = true;

Properties

protected $enableLoggingModelsEvents
protected $oldAttributes

Methods

static 
bootLogsActivity()

No description

disableLogging()

No description

enableLogging()

No description

activity()

No description

getMessageForEvent($eventName)

No description

getLogNameToUse($eventName = '')

No description

static 
eventsToBeRecorded()

Get the event names that should be recorded.

attributesToBeIgnored()

No description

shouldLogOnlyDirty()

No description

attributesToBeLogged()

No description

shouldLogEvent($eventName)

No description

attributeValuesToBeLogged($processingEvent)

No description

static 
logChanges(Model $model)

No description

static 
getRelatedModelAttributeValue(Model $model, $attribute)

No description

Details

at line 43
static protected bootLogsActivity()

No description

at line 72
disableLogging()

No description

at line 79
enableLogging()

No description

at line 86
activity()

No description

at line 91
getMessageForEvent($eventName)

No description

Parameters

$eventName

at line 96
getLogNameToUse($eventName = '')

No description

Parameters

$eventName

at line 104
static protected eventsToBeRecorded()

Get the event names that should be recorded.

at line 123
attributesToBeIgnored()

No description

at line 135
ActivityLogger getActivityLogger()

No description

Return Value

ActivityLogger

at line 140
shouldLogOnlyDirty()

No description

at line 149
attributesToBeLogged()

No description

at line 158
protected shouldLogEvent($eventName)

No description

Parameters

$eventName

at line 178
attributeValuesToBeLogged($processingEvent)

No description

Parameters

$processingEvent

at line 202
static logChanges(Model $model)

No description

Parameters

Model $model

at line 217
static protected getRelatedModelAttributeValue(Model $model, $attribute)

No description

Parameters

Model $model
$attribute