allocation activity

This commit is contained in:
robert dennis
2026-10-12 05:18:56 -04:00
parent 84695d2f0a
commit bdfdab5d3d
9 changed files with 30 additions and 23 deletions
@@ -5,14 +5,23 @@ declare(strict_types=1);
namespace Pterodactyl\Actions\Allocations;
use Pterodactyl\Contracts\Allocations\UpdatesAllocationNotes;
use Pterodactyl\Facades\Activity;
use Pterodactyl\Models\Allocation;
final class UpdateAllocationNotes implements UpdatesAllocationNotes
{
public function update(Allocation $allocation, ?string $notes): Allocation
{
$original = $allocation->notes;
$allocation->forceFill(['notes' => $notes])->save();
if ($original !== $notes) {
Activity::event('server:allocation.notes')
->subject($allocation->server, $allocation)
->property(['allocation' => $allocation->toString(), 'old' => $original, 'new' => $notes])
->log();
}
return $allocation;
}
}