From 999c460b71b6c01fcfecb6cc037580252224e6e4 Mon Sep 17 00:00:00 2001 From: Christhofer Natalius Date: Sat, 18 Dec 2021 10:27:00 +0700 Subject: [PATCH 1/2] Update README.md Adds how to get event id after creating new event. Thanks to [guiwestrup's comment](https://github.com/spatie/laravel-google-calendar/issues/161#issuecomment-674042327) --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index daee731..d21d892 100644 --- a/README.md +++ b/README.md @@ -258,6 +258,11 @@ Google assigns a unique id to every single event. You can get this id by getting ```php // get the id of the first upcoming event in the calendar. $eventId = Event::get()->first()->id; + +// you can also get the id after creating the event, then you can save it to database. +$event = new Event; +$newEvent = $event->save(); +dd($newEvent->id); // e.g "s663g0m8crhnrpfh5eplqtd2ac" ``` You can use this id to fetch a single event from Google: From cd21a1aef020b9d004cd22889867b6e35d95a0fa Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Sat, 18 Dec 2021 12:55:42 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d21d892..b5915cb 100644 --- a/README.md +++ b/README.md @@ -262,7 +262,7 @@ $eventId = Event::get()->first()->id; // you can also get the id after creating the event, then you can save it to database. $event = new Event; $newEvent = $event->save(); -dd($newEvent->id); // e.g "s663g0m8crhnrpfh5eplqtd2ac" +echo $newEvent->id; // displey the event id ``` You can use this id to fetch a single event from Google: