payload = $payload; } public function getActor(): ?Notifiable { return new Notifiable(Arr::get($this->payload, "info.users." . $this['auth'])); } public function getSubject(): ?Notifiable { return new Notifiable( Arr::get($this->payload, "info.users." . $this['data']['original']['user_id']) ); } public function getOwners(): Collection { return new Collection( Arr::where($this->payload['info']['users'], fn ($user) => $user['level'] === 4) ); } public function getTableName(): ?Stringable { return Str::of(Arr::get($this->payload, "data.table_name")); } public function getActId() { return Arr::get($this->payload, "data.crud_id"); } public function getTitle() { return Arr::get($this->payload, "info.name"); } public function isPivot(): bool { return $this->getTableName()->contains("_"); } public function offsetExists($key) { return isset($this->payload[$key]); } public function offsetGet($key) { return $this->payload[$key]; } public function offsetSet($key, $value) { if (is_null($key)) { $this->payload[] = $value; } else { $this->payload[$key] = $value; } } public function offsetUnset($key) { unset($this->payload[$key]); } }