Files
pterodactyl-panel/app/Events/ActivityLogged.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

35 lines
703 B
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Events;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
use Pterodactyl\Models\ActivityLog;
class ActivityLogged extends Event
{
public function __construct(public ActivityLog $model) {}
public function is(string $event): bool
{
return $this->model->event === $event;
}
public function actor(): ?Model
{
return $this->isSystem() ? null : $this->model->actor;
}
public function isServerEvent(): bool
{
return Str::startsWith($this->model->event, 'server:');
}
public function isSystem(): bool
{
return $this->model->actor_id === null;
}
}