Final changes

This commit is contained in:
2026-06-30 14:06:11 +02:00
parent 176a883633
commit 22893fd957
29 changed files with 316 additions and 60 deletions

View File

@@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Str;
use League\CommonMark\GithubFlavoredMarkdownConverter;
use Spatie\Activitylog\Models\Concerns\LogsActivity;
use Spatie\Activitylog\Support\LogOptions;
/**
* @property int $id
@@ -41,7 +43,7 @@ use League\CommonMark\GithubFlavoredMarkdownConverter;
class EntryReview extends Model
{
use HasXenforoUserId, SoftDeletes;
use HasXenforoUserId, SoftDeletes, LogsActivity;
protected $fillable = [ 'entry_id', 'title', 'rating', 'description', 'user_id' ];
@@ -60,4 +62,14 @@ class EntryReview extends Model
return $converter->convert($this->description)->getContent();
}
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()
->useLogName('review')
->logAll()
->logOnlyDirty()
->dontLogEmptyChanges()
->setDescriptionForEvent(fn(string $eventName) => "Review {$eventName}");
}
}