I'm using a laravel package for the google calendar API integration. In that, I am able to create events with just attendees only. I've tried creating organizer but it's not coming up. The following is the code I've used. The organizer name here defaults to the email from which the API credentials are created also the email notifications are not coming.
The package I'm using is spatie/laravel-google-calendar
Can anyone tell me what I'm doing wrong here?
Event::create([
'name' => 'Latest Event dsfdsfsdfsdf',
'location' => '800 Howard St., San Francisco, CA 94103',
'description' => 'A chance to hear more about Google\'s developer products.',
'startDateTime' => Carbon\Carbon::now(),
'endDateTime' => Carbon\Carbon::now()->addHour(),
'sendNotifications' => true,
'sendUpdates' => 'all',
'organizer' => array('email' => '[email protected]','displayName' => 'Darshan')
'attendees' => array(
array('email' => '[email protected]','displayName' => 'Darshan', 'organizer' => true),
array('email' => '[email protected]','displayName' => 'Ryan')
)
]);
The package doesn't support adding an organizer yet. You could either add the functionality to the package or you could use the Google ApiClient directly. The Google Sdk does have a setOrganizer
method which should work similar to the setAttendees
method that is called in the Event class.
Apparently the word "organizer" is bit of a misnomer and it actually refers to the calendar that the event is created on. Have a look at this question and it's comments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With