PHP code example of slakbal / gotowebinar
1. Go to this page and download the library: Download slakbal/gotowebinar library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
slakbal / gotowebinar example snippets
'providers' => [
// ...
Slakbal\Gotowebinar\GotoWebinarServiceProvider::class
];
'aliases' => [
// ...
'Webinars' => Slakbal\\Gotowebinar\\Facade\\Webinars,
'Registrants' => Slakbal\\Gotowebinar\\Facade\\Registrants,
'Attendees' => Slakbal\\Gotowebinar\\Facade\\Attendees
'Sessions' => Slakbal\\Gotowebinar\\Facade\\Sessions
];
php artisan vendor:publish
php artisan route:list
_goto
_goto/ping
_goto/authenticate
_goto/flush-auth
_goto/webinars
_goto/webinars/create
_goto/webinars/createByArray
_goto/webinars/{webinarKey}/view
_goto/webinars/{webinarKey}/update
_goto/webinars/{webinarKey}/updateByArray
_goto/webinars/{webinarKey}/registrants
_goto/webinars/{webinarKey}/registrants/create
_goto/webinars/{webinarKey}/registrants/{registrantKey}/view
_goto/webinars/{webinarKey}/registrants/{registrantKey}/delete
_goto/webinars/{webinarKey}/attendees
_goto/webinars/{webinarKey}/delete
_goto/webinars/{webinarKey}/sessions
_goto/webinars/{webinarKey}/sessions/{sessionKey}
_goto/webinars/{webinarKey}/sessions/{sessionKey}/performance
_goto/webinars/{webinarKey}/sessions/{sessionKey}/polls
_goto/webinars/{webinarKey}/sessions/{sessionKey}/questions
_goto/webinars/{webinarKey}/sessions/{sessionKey}/surveys
_goto/webinars/{webinarKey}/sessions/{sessionKey}/attendees
_goto/webinars/{webinarKey}/sessions/{sessionKey}/attendees/{registrantKey}
_goto/webinars/{webinarKey}/sessions/{sessionKey}/attendees/{registrantKey}/polls
_goto/webinars/{webinarKey}/sessions/{sessionKey}/attendees/{registrantKey}/questions
_goto/webinars/{webinarKey}/sessions/{sessionKey}/attendees/{registrantKey}/surveys
Webinars::status();
//note methods are also chainable
Webinars::authenticate()->status();
Webinars::flushAuthentication()->status();
try {
return Webinars::subject('Event Name')
->description('Event Description*')
->timeFromTo(Carbon::now()->addDays(10), Carbon::now()->addDays(10)->addHours(1))
->timeZone('Europe/Amsterdam')
->singleSession()
->noEmailReminder()
->noEmailAttendeeFollowUp()
->noEmailAbsenteeFollowUp()
->noEmailConfirmation()
->create();
} catch (Slakbal\Gotowebinar\Exception\GotoException $e) {
return [$e->getMessage()];
}
$gotoResponse->webinarKey
try {
$gotoResponse = GotoWebinar::createWebinar($eventParams);
} catch (GotoException $e) {
//do something, go somewhere or notifify someone
}
[2017-09-21 00:14:38] local.ERROR: GotoWebinar: DELETE - Not Found (404): Webinar with specified key does not exist.
$from = Carbon::now()->subYear()->startOfDay();
$to = Carbon::tomorrow()->endOfDay();
// Example URL: _goto/webinars?page=10&size=1
$page = request()->query('page') ?? 0;
$size = request()->query('size') ?? 5;
try {
return Webinars::fromTime($from)
->toTime($to)
->page($page)
->size($size)
->get();
} catch (Slakbal\Gotowebinar\Exception\GotoException $e) {
return [$e->getMessage()];
}
return Webinars::subject('Event Name')
->description('Event Description')
->timeFromTo(Carbon::now()->addDays(10), Carbon::now()->addDays(10)->addHours(1))
->timeZone('Europe/Amsterdam')
->singleSession()
->noEmailReminder()
->noEmailAttendeeFollowUp()
->noEmailAbsenteeFollowUp()
->noEmailConfirmation()
->create();
return Webinars::noEmailReminder()
->timeFromTo(Carbon::now()->addDays(10), Carbon::now()->addDays(10)->addHours(1))
->create([
'subject' => 'Event Name',
'description' => 'Event Description*',
'timeZone' => 'Europe/Amsterdam',
'type' => 'single_session',
'isPasswordProtected' => false,
]);
return Webinars::webinarKey($webinarKey)
->subject('Updated Event Name')
->description('Updated Event Description*')
->timeFromTo(Carbon::now()->addDays(10)->midDay(), Carbon::now()->addDays(10)->midDay()->addHours(2))
->update();
return Webinars::webinarKey($webinarKey)
->timeFromTo(Carbon::now()->addDays(10), Carbon::now()->addDays(10)->addHours(2))
->update([
'subject' => 'Event Name',
'description' => 'UPDATED Event Description',
'timeZone' => 'Europe/Amsterdam',
'isPasswordProtected' => false,
]);
return Webinars::webinarKey($webinarKey)
->get();
return Webinars::webinarKey($webinarKey)
->sendCancellationEmails()
->delete();
return Webinars::webinarKey($webinarKey)
->page($page)
->size($size)
->get();
return Webinars::webinarKey($webinarKey)
->meetingTimes()
->get();
return Webinars::webinarKey($webinarKey)
->audio()
->get();
return Webinars::webinarKey($webinarKey)
->performance()
->get();
$from = Carbon::now()->subYears(50)->startOfDay();
$to = Carbon::now()->addYears(50)->endOfDay();
return Webinars::insessionWebinars()
->fromTime($from)
->toTime($to)
->get();
return Registrants::webinarKey($webinarKey)
->get();
return Registrants::webinarKey($webinarKey)
->firstName('John')
->lastName('Doe')
->timeZone('America/Chicago')
->email('[email protected] ')
->resendConfirmation()
->questionsAndComments('Some First Question')
->create();
return Registrants::webinarKey($webinarKey)
->resendConfirmation()
->create([
'firstName' => 'Peters',
'lastName' => 'Panske',
'email' => '[email protected] ',
'timezone' => 'Europe/Amsterdam',
'phone' => '123',
'country' => 'SA',
'zipcode' => '123',
'source' => 'somewhere',
'address' => '123 Some street',
'city' => 'Some City',
'state' => 'Some State',
'organization' => 'Some Org',
'jobTitle' => 'Boss',
'questionsAndComments' => 'Some Question',
'industry' => 'Some Industry',
'numberOfEmployees' => 'Boss',
'purchasingTimeFrame' => 'Very soon',
'purchasingRole' => 'Some Buyer Role',
]);
return Registrants::webinarKey($webinarKey)
->registrantKey($registrantKey)
->get();
return Registrants::webinarKey($webinarKey)
->registrantKey($registrantKey)
->delete();
$from = Carbon\Carbon::now()->subYears(50)->startOfDay();
$to = Carbon\Carbon::now()->addYears(50)->endOfDay();
// Example: sessions?page=10&size=1
$page = request()->query('page') ?? 0;
$size = request()->query('size') ?? 5;
return Sessions::organizerSessions()
->fromTime($from)
->toTime($to)
->page($page)
->size($size)
->get();
// Example: sessions?page=10&size=1
$page = request()->query('page') ?? 0;
$size = request()->query('size') ?? 5;
return Sessions::webinarKey($webinarKey)
->page($page)
->size($size)
->get();
return Sessions::webinarKey($webinarKey)
->sessionKey($sessionKey)
->get();
return Sessions::webinarKey($webinarKey)
->sessionKey($sessionKey)
->performance()
->get();
return Sessions::webinarKey($webinarKey)
->sessionKey($sessionKey)
->polls()
->get();
return Sessions::webinarKey($webinarKey)
->sessionKey($sessionKey)
->questions()
->get();
return Sessions::webinarKey($webinarKey)
->sessionKey($sessionKey)
->surveys()
->get();
return Attendees::webinarKey($webinarKey)
->sessionKey($sessionKey)
->get();
return Attendees::webinarKey($webinarKey)
->sessionKey($sessionKey)
->registrantKey($registrantKey)
->get();
return Attendees::webinarKey($webinarKey)
->sessionKey($sessionKey)
->registrantKey($registrantKey)
->polls()
->get();
return Attendees::webinarKey($webinarKey)
->sessionKey($sessionKey)
->registrantKey($registrantKey)
->questions()
->get();
return Attendees::webinarKey($webinarKey)
->sessionKey($sessionKey)
->registrantKey($registrantKey)
->surveys()
->get();