diff --git a/src/Data/EventData.php b/src/Data/EventData.php index 9e2b684..56127a9 100644 --- a/src/Data/EventData.php +++ b/src/Data/EventData.php @@ -11,7 +11,9 @@ class EventData implements Arrayable protected int|string|null $groupId = null; - protected int|string|array|null $resourceId = null; + protected int|string|null $resourceId = null; + + protected ?array $resourceIds = null; protected bool $allDay = false; @@ -32,7 +34,6 @@ class EventData implements Arrayable protected ?string $textColor = null; protected ?array $extendedProps = null; - protected array $extraProperties = []; public static function make(): static @@ -64,15 +65,24 @@ public function groupId(int|string $groupId): static * Events can be associated with a resource when its resourceId property matches one of * the resource object’s id field */ - public function resourceId(int|string|array $resourceId): static + public function resourceId(int|string $resourceId): static { $this->resourceId = $resourceId; return $this; } + /** + * It is also possible to associate an event with multiple resources using the resourceIds property. + */ + public function resourceIds(array $resourceIds): static + { + $this->resourceIds = $resourceIds; + return $this; + } /** - * Determines if the event is shown in the “all-day” section of relevant views. In addition, if true the time text is not displayed with the event. + * Determines if the event is shown in the “all-day” section of relevant views. In addition, + * if true the time text is not displayed with the event. */ public function allDay(bool $allDay = true): static { @@ -182,6 +192,7 @@ public function toArray(): array 'end' => $this->end, 'title' => $this->title, ...$this->resourceId ? ['resourceId' => $this->resourceId] : [], + ...$this->resourceIds ? ['resourceIds' => $this->resourceIds] : [], ...$this->url ? ['url' => $this->url, 'shouldOpenUrlInNewTab' => $this->shouldOpenUrlInNewTab] : [], ...$this->groupId ? ['groupId' => $this->groupId] : [], ...$this->allDay ? ['allDay' => $this->allDay] : [],