Skip to content

Alternate Spatie activity_log table name #9

Description

@fbmfbm

Hi Muhammad,

Great job, but no way to use alternate table_log name, as Spatiy Activitylog config allow it ?

spatie doc

Custom table name or database connection
If you need to use a custom table name or database connection, create a custom Activity model that extends the default one:

use Spatie\Activitylog\Models\Activity as BaseActivity;

class Activity extends BaseActivity
{
    protected $table = 'my_custom_activity_log';

    protected $connection = 'my_custom_connection';
}

Then set it in the config:

'activity_model' => \App\Models\Activity::class,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions