mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-04 05:15:41 -05:00
allocation activity
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user