Skip to content

Commit

Permalink
🔊 log moderation activity (#3158)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu authored Jan 16, 2025
1 parent 1cad431 commit b9c6d07
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/Models/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Auth;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;

/**
* //properties
Expand Down Expand Up @@ -41,7 +43,7 @@
class Status extends Model
{

use HasFactory;
use HasFactory, LogsActivity;

protected $fillable = [
'user_id', 'body', 'business', 'visibility', 'event_id', 'mastodon_post_id', 'client_id',
Expand Down Expand Up @@ -126,4 +128,8 @@ public function getDescriptionAttribute(): string {
public function getStatusInvisibleToMeAttribute(): bool {
return !request()?->user()?->can('view', $this);
}

public function getActivitylogOptions(): LogOptions {
return LogOptions::defaults()->logOnly(['moderation_notes', 'lock_visibility', 'hide_body']);
}
}

0 comments on commit b9c6d07

Please sign in to comment.