- All models now need to define a
getActivitylogOptions()
method to configure and return the models options as aLogOptions
instance. - To control what attributes are logged, instead of defining a
$logAttributes
property this is defined in thegetActivitylogOptions()
method using thelogOnly()
method ofLogOptions
. - The
getDescriptionForEvent()
method is no longer used to customize the description. Instead, use thesetDescriptionForEvent()
method forLogOptions
class. - When customizing the log's name instead of defining a
$logName
property, call theuseLogName()
method when configuring theLogOptions
. - Instead of the
$ignoreChangedAttributes
property thedontLogIfAttributesChangedOnly()
method should be used. - If you only need to log the dirty attributes use
logOnlyDirty()
since the$logOnlyDirty
property is no longer used. - For instances where you do not want to store empty log events use
dontSubmitEmptyLogs()
instead of setting$submitEmptyLogs
tofalse
. - When you use a
*
(wildcard) and want to ignore specific elements use thedontLogIfAttributesChangedOnly()
method instead of the$logAttributesToIgnore
property.
- if you are using a custom
Activity
model, you should let it implement the newSpatie\Activitylog\Contracts\Activity
interface - the preferred way to get changes on an
Activity
model is through thechanges
property instead of thechanges()
function. Change all usages from$activity->changes()
to$activity->changes
- the
activity
relation of theCausesActivity
trait has been renamed toactions
. Rename all uses from$user->activity
to$user->actions
- the
activity
relation of theLogsActivity
trait has been renamed toactivities
. Rename all uses from$yourModel->activity
to$yourModel->activities
. - the deprecated
loggedActivity
relation has been removed. Useactivities
instead. - the
HasActivity
trait has been removed. Use bothCausesActivity
andLogsActivity
traits instead.