Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Command to create a App\Models\Traits\LogsActivity #23

Open
tabacitu opened this issue Aug 31, 2023 · 0 comments
Open

Comments

@tabacitu
Copy link
Member

tabacitu commented Aug 31, 2023

Upon installing this package, if I haven't already installed and set up spatie/laravel-activitylog, I want this package to make it easier for me to implement the most common scenario.

I want to run php artisan backpack:activity-log:create-trait, and it will create this:

<?php

namespace App\Models\Traits;

use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity as OriginalLogsActivity;

trait LogsActivity
{
    use OriginalLogsActivity;

    /**
     * Spatie Log Options
     * By default will log only the changes between fillables
     *
     * @return LogOptions
     */
    public function getActivitylogOptions(): LogOptions
    {
        return LogOptions::defaults()->logAll()->logOnlyDirty();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant