Skip to content

Commit

Permalink
ref: LogMasksAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
fzldn committed Sep 16, 2024
1 parent dbad88e commit 3e93d2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions app/Models/Traits/LogsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

namespace App\Models\Traits;

use App\Support\LogMasksAttributes;
use App\Support\LogMasksAttribute;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;

trait LogsModel
{
use LogsActivity;

protected static array $maskedAttributes = ['password'];

public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()
Expand All @@ -33,6 +31,6 @@ public function logExcept(): array

public static function bootLogsModel(): void
{
static::addLogChange(new LogMasksAttributes(static::$maskedAttributes));
static::addLogChange(new LogMasksAttribute);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
use Spatie\Activitylog\Contracts\LoggablePipe;
use Spatie\Activitylog\EventLogBag;

class LogMasksAttributes implements LoggablePipe
class LogMasksAttribute implements LoggablePipe
{
public function __construct(public array $attributes) {}
protected array $attributes = ['password'];

public function handle(EventLogBag $event, \Closure $next): EventLogBag
{
Expand Down

0 comments on commit 3e93d2f

Please sign in to comment.