You are on page 1of 2

Note: The default migration assumes you are using integers for your model IDs.

If
you are using UUIDs, or some other format, adjust the format of the subject_id and
causer_id fields in the published migration before continuing.

After publishing the migration you can create the activity_log table by running the
migrations:

php artisan migrate

You can optionally publish the config file with:

php artisan vendor:publish


--provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="config"

This is the contents of the published config file:

return [

/*
* If set to false, no activities will be saved to the database.
*/
'enabled' => env('ACTIVITY_LOGGER_ENABLED', true),

/*
* When the clean-command is executed, all recording activities older than
* the number of days specified here will be deleted.
*/
'delete_records_older_than_days' => 365,

/*
* If no log name is passed to the activity() helper
* we use this default log name.
*/
'default_log_name' => 'default',

/*
* You can specify an auth driver here that gets user models.
* If this is null we'll use the default Laravel auth driver.
*/
'default_auth_driver' => null,

/*
* If set to true, the subject returns soft deleted models.
*/
'subject_returns_soft_deleted_models' => false,

/*
* This model will be used to log activity.
* It should be implements the Spatie\Activitylog\Contracts\Activity interface
* and extend Illuminate\Database\Eloquent\Model.
*/
'activity_model' => \Spatie\Activitylog\Models\Activity::class,

/*
* This is the name of the table that will be created by the migration and
* used by the Activity model shipped with this package.
*/
'table_name' => 'activity_log',
];
Changelog

You might also like