├── .php_cs ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── UPGRADE.md ├── composer.json ├── config └── config.php ├── psalm.xml └── src ├── Absentees.php ├── Account.php ├── Assistant.php ├── AuthenticationOption.php ├── Contracts └── Zoom.php ├── CustomQuestion.php ├── EmailNotification.php ├── Exceptions ├── FileTooLargeException.php └── ValidationException.php ├── Facades ├── Client.php └── Zoom.php ├── Feature.php ├── File.php ├── GlobalDialInCountry.php ├── GlobalDialInNumber.php ├── InMeeting.php ├── Instance.php ├── Integration.php ├── Invitation.php ├── LiveStream.php ├── LiveStreamStatus.php ├── LiveStreamStatusSetting.php ├── Meeting.php ├── MeetingOccurrence.php ├── MeetingParticipant.php ├── MeetingPasswordRequirement.php ├── MeetingRecording.php ├── MeetingRegistrant.php ├── MeetingSetting.php ├── Panelist.php ├── Participant.php ├── PastMeeting.php ├── PastWebinar.php ├── Permission.php ├── Poll.php ├── PollQuestion.php ├── PollResult.php ├── Privilege.php ├── Providers └── ZoomServiceProvider.php ├── QA.php ├── Question.php ├── QuestionAnswer.php ├── Recording.php ├── RecordingFile.php ├── RecordingPasswordRequirement.php ├── Recurrence.php ├── RegistrantCustomQuestion.php ├── RegistrationQuestion.php ├── Requests ├── StoreAccount.php ├── StoreAssistant.php ├── StoreCustomQuestion.php ├── StoreEmailNotification.php ├── StoreGlobalDialInCountry.php ├── StoreGlobalDialInNumber.php ├── StoreMeeting.php ├── StoreMeetingSetting.php ├── StorePanelist.php ├── StorePoll.php ├── StorePollQuestion.php ├── StoreQuestionAnswer.php ├── StoreRecurrence.php ├── StoreRegistrant.php ├── StoreRegistrantCustomQuestion.php ├── StoreRole.php ├── StoreTrackingField.php ├── StoreUser.php ├── StoreWebinar.php ├── StoreWebinarSetting.php ├── UpdateAccount.php ├── UpdateAssistant.php ├── UpdateCustomQuestion.php ├── UpdateEmailNotification.php ├── UpdateFeature.php ├── UpdateGlobalDialInCountry.php ├── UpdateGlobalDialInNumber.php ├── UpdateInMeeting.php ├── UpdateIntegration.php ├── UpdateLiveStream.php ├── UpdateLiveStreamStatus.php ├── UpdateLiveStreamStatusSetting.php ├── UpdateMeeting.php ├── UpdateMeetingPasswordRequirement.php ├── UpdateMeetingSetting.php ├── UpdateOccurrence.php ├── UpdatePoll.php ├── UpdatePollQuestion.php ├── UpdateQuestion.php ├── UpdateRecording.php ├── UpdateRecordingPasswordRequirement.php ├── UpdateRecurrence.php ├── UpdateRegistrationQuestion.php ├── UpdateRole.php ├── UpdateScheduleMeeting.php ├── UpdateSetting.php ├── UpdateTelephony.php ├── UpdateTrackingField.php ├── UpdateTsp.php ├── UpdateUser.php ├── UpdateWebinar.php └── UpdateWebinarSetting.php ├── Role.php ├── ScheduleMeeting.php ├── Scheduler.php ├── Setting.php ├── Support ├── Client.php ├── Entry.php └── Model.php ├── Telephony.php ├── Token.php ├── TrackingField.php ├── TrackingSource.php ├── Tsp.php ├── User.php ├── Webinar.php ├── WebinarOccurrence.php ├── WebinarParticipant.php ├── WebinarRegistrant.php └── WebinarSetting.php /.php_cs: -------------------------------------------------------------------------------- 1 | notPath('bootstrap/*') 5 | ->notPath('storage/*') 6 | ->notPath('storage/*') 7 | ->notPath('resources/view/mail/*') 8 | ->in([ 9 | __DIR__ . '/src', 10 | __DIR__ . '/tests', 11 | ]) 12 | ->name('*.php') 13 | ->notName('*.blade.php') 14 | ->ignoreDotFiles(true) 15 | ->ignoreVCS(true); 16 | 17 | return PhpCsFixer\Config::create() 18 | ->setRules([ 19 | '@PSR2' => true, 20 | 'array_syntax' => ['syntax' => 'short'], 21 | 'ordered_imports' => ['sortAlgorithm' => 'alpha'], 22 | 'no_unused_imports' => true, 23 | 'not_operator_with_successor_space' => true, 24 | 'trailing_comma_in_multiline_array' => true, 25 | 'phpdoc_scalar' => true, 26 | 'unary_operator_spaces' => true, 27 | 'binary_operator_spaces' => true, 28 | 'blank_line_before_statement' => [ 29 | 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], 30 | ], 31 | 'phpdoc_single_line_var_spacing' => true, 32 | 'phpdoc_var_without_name' => true, 33 | 'method_argument_space' => [ 34 | 'on_multiline' => 'ensure_fully_multiline', 35 | 'keep_multiple_spaces_after_comma' => true, 36 | ] 37 | ]) 38 | ->setFinder($finder); 39 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to `laravel-zoom` will be documented in this file 4 | 5 | ## 4.1.5 - 2021-01-06 6 | 7 | Allow override of config API key and secret in Entry Model 8 | 9 | ## 4.1.4 - 2021-01-05 10 | 11 | PHP 8.0 12 | 13 | ## 4.1.0 - 2020-09-08 14 | 15 | Laravel 8.0 16 | 17 | ## 4.0.8 - 2020-07-16 18 | 19 | Add Recordings 20 | 21 | ## 4.0.1 - 4.0.7 - Bug fixes 22 | 23 | ## 4.0.0 - 2020-05-27 24 | 25 | Updated version for Laravel 7.0 26 | 27 | ## 3.0.8 - 2020-07-16 28 | 29 | Add Recordings 30 | 31 | ## 3.0.1 - 3.0.7 - Bug fixes 32 | 33 | ## 3.0.0 - 2020-05-27 34 | 35 | Updated version for Laravel 6.0 36 | 37 | ## 2.0.9 - 2020-07-16 38 | 39 | Added get user and meeting recordings 40 | 41 | ## 2.0.1 - 2.0.8 - Small bug fixes 42 | 43 | ## 2.0.0 - 2020-05-27 44 | 45 | Updated version for Laravel 5.5 - 5.8 46 | 47 | ## 1.0.15 - 2019-08-02 48 | 49 | Update $query_attributes to $queryAttributes to be in line 50 | 51 | ## 1.0.14 - 2019-07-28 52 | 53 | Bug fix on issue with registrant relationship 54 | 55 | ## 1.0.13 - 2019-07-26 56 | 57 | Bug fix on multiple relationships 58 | 59 | ## 1.0.12 - 2019-07-26 60 | 61 | Change getResponse method to a none static method 62 | 63 | ## 1.0.11 - 2019-07-26 64 | 65 | Change Model to return itself on save instead of the array response 66 | 67 | ## 1.0.10 - 2019-07-26 68 | 69 | replace Guzzle getContents with getBody 70 | 71 | ## 1.0.9 - 2019-07-26 72 | 73 | Fix issue with Facade 74 | 75 | ## 1.0.8 - 2019-07-26 76 | 77 | Added return statements to various methods to allow chaining. 78 | 79 | Bug Fix: 80 | When creating a new meeting for an existing contact the userID would not pass if it was set before the create method. We now pass the userID in teh make statement if its set. 81 | 82 | ## 1.0.7 - 2019-07-25 83 | 84 | Update models to use new query return function 85 | 86 | ## 1.0.6 - 2019-07-25 87 | 88 | Fix type 89 | 90 | ## 1.0.5 - 2019-07-25 91 | 92 | Change where clause to act like Laravel. 93 | 94 | You can now do either 95 | 96 | where('key', 'value') 97 | 98 | or 99 | 100 | where('key', '=', 'value') 101 | 102 | ## 1.0.4 - 2019-07-25 103 | 104 | Update all relationship models to use getID function 105 | 106 | ## 1.0.3 - 2019-07-25 107 | 108 | Update delete method and other functions to use GetID function 109 | 110 | ## 1.0.2 - 2019-07-25 111 | 112 | Update create method to use the static make method 113 | 114 | ## 1.0.1 - 2019-07-25 115 | 116 | - Bug fixes :- 117 | Removed bug when deleting 118 | Removed bug when selecting multiple records 119 | 120 | ## 1.0.0 - 2019-06-26 121 | 122 | - Initial release 123 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | Please read and understand the contribution guide before creating an issue or pull request. 6 | 7 | ## Etiquette 8 | 9 | This project is open source, and as such, the maintainers give their free time to build and maintain the source code held within. They make the code freely available in the hope that it will be of use to other developers. It would be extremely unfair for them to suffer abuse or anger for their hard work. 10 | 11 | Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the world that developers are civilized and selfless people. 12 | 13 | It's the duty of the maintainer to ensure that all submissions to the project are of sufficient quality to benefit the project. Many developers have different skill sets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. 14 | 15 | ## Viability 16 | 17 | When requesting or submitting new features, first consider whether it might be useful to others. Open source projects are used by many developers, who may have entirely different needs to your own. Think about whether or not your feature is likely to be used by other users of the project. 18 | 19 | ## Procedure 20 | 21 | Before filing an issue: 22 | 23 | - Attempt to replicate the problem, to ensure that it wasn't a coincidental incident. 24 | - Check to make sure your feature suggestion isn't already present within the project. 25 | - Check the pull requests tab to ensure that the bug doesn't have a fix in progress. 26 | - Check the pull requests tab to ensure that the feature isn't already in progress. 27 | 28 | Before submitting a pull request: 29 | 30 | - Check the codebase to ensure that your feature doesn't already exist. 31 | - Check the pull requests to ensure that another person hasn't already submitted the feature or fix. 32 | 33 | ## Requirements 34 | 35 | If the project maintainer has any additional requirements, you will find them listed here. 36 | 37 | - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer). 38 | 39 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests. 40 | 41 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 42 | 43 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option. 44 | 45 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 46 | 47 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 48 | 49 | **Happy coding**! 50 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Macsi Digital Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Laravel Zoom 2 | 3 | ## Laravel Zoom API Client 4 | 5 | ![Header Image](https://github.com/MacsiDigital/repo-design/raw/master/laravel-zoom/header.png) 6 | 7 |

8 | tests badge 9 | version badge 10 | downloads badge 11 |

12 | 13 | Laravel Zoom API Package 14 | 15 | ## Support us 16 | 17 | We invest a lot in creating [open source packages](https://macsidigital.co.uk/open-source), and would be grateful for a [sponsor](https://github.com/sponsors/MacsiDigital) if you make money from your product that uses them. 18 | 19 | ## Our API mission! 20 | 21 | Let's be honest, API's are all over the place and so inconsistent. We are therefore setting out to try to change this for all Laravel user's who need an API client and have developed an [API Client Library](https://github.com/MacsiDigital/laravel-api-client), which our API's are built on top of, to give a common set of consistent functionality. 22 | 23 | ## Updates & Issues 24 | 25 | We only accept Issues through [Github](https://github.com/MacsiDigital/laravel-zoom) 26 | 27 | We update security and bug fixes as soon as we can, other pull requests and enhancements will be as and when we can do them. 28 | 29 | You can follow us on Twitter where we will post any major updates. [MacsiDigital Twitter](https://twitter.com/MacsiDigital) 30 | 31 | ## Installation 32 | 33 | You can install the package via composer: 34 | 35 | ```bash 36 | composer require macsidigital/laravel-zoom 37 | ``` 38 | 39 | For versioning:- 40 | 41 | - 1.0 - deprecated - was a quick build for a client project, not recommended you use this version. 42 | 43 | - 2.0 - Laravel 5.5 - 5.8 - deprecated, no longer maintained 44 | 45 | - 3.0 - Laravel 6.0 - Maintained, feel free to create pull requests. This is open source which is a 2 way street. 46 | 47 | - 4.0 - Laravel 7.0 - 8.0 - Maintained, feel free to create pull requests. This is open source which is a 2 way street. 48 | 49 | ### Configuration file 50 | 51 | Publish the configuration file 52 | 53 | ```bash 54 | php artisan vendor:publish --provider="MacsiDigital\Zoom\Providers\ZoomServiceProvider" 55 | ``` 56 | 57 | This will create a zoom.php config file within your config directory:- 58 | 59 | ```php 60 | return [ 61 | 'apiKey' => env('ZOOM_CLIENT_KEY'), 62 | 'apiSecret' => env('ZOOM_CLIENT_SECRET'), 63 | 'baseUrl' => 'https://api.zoom.us/v2/', 64 | 'token_life' => 60 * 60 * 24 * 7, // In seconds, default 1 week 65 | 'authentication_method' => 'jwt', // Only jwt compatible at present 66 | 'max_api_calls_per_request' => '5' // how many times can we hit the api to return results for an all() request 67 | ]; 68 | ``` 69 | 70 | You need to add ZOOM_CLIENT_KEY and ZOOM_CLIENT_SECRET into your .env file. 71 | 72 | Also note the tokenLife, there were numerous users of the old API who said the token expired to quickly, so we have set for a longer lifeTime by default and more importantly made it customisable. 73 | 74 | That should be it. 75 | 76 | ## Usage 77 | 78 | Everything has been set up to be similar to Laravel syntax. So hopefully using it will be similar to Eloquent, right down to relationships. 79 | 80 | Unfortunately the Zoom API is not very uniform and is a bit all over the place. But we have hopefully made this uniform and logical. However you will still need to read the [Zoom documentation](https://marketplace.zoom.us/docs/api-reference/introduction) to know what is and isn't possible. 81 | 82 | At present we cover the following modules 83 | 84 | - Users 85 | - Roles 86 | - Meetings 87 | - Past Meetings 88 | - Webinars 89 | - Past Webinars 90 | - Recordings 91 | 92 | Doesn't look like a lot but Meetings and Webinars are the 2 big modules and includes, polls, registration questions, registrants, panelists and various other relationships. 93 | 94 | Also note that some of the functionality is only available to certain plan types. Check the [Zoom documentation](https://marketplace.zoom.us/docs/api-reference/introduction). 95 | 96 | ### Connecting 97 | 98 | To get an access point you can simply create a new instance and the resource. 99 | 100 | ``` php 101 | $user = Zoom::user(); 102 | ``` 103 | 104 | ### Accessing models 105 | 106 | There are 2 main ways to work with models, to call them directly from the access entry point via a facade, or to call them in the standard php 'new' method and pass in the access entry point 107 | 108 | ``` php 109 | $user = Zoom::user(); 110 | 111 | //or 112 | 113 | $zoom = new \MacsiDigital\Zoom\Support\Entry; 114 | $user = new \MacsiDigital\Zoom\User($zoom); 115 | ``` 116 | 117 | ### Custom settings 118 | If you would like to use different configuration values than those in your zoom.php config file, you can feed those as parameters to \MacsiDigital\Zoom\Support\Entry as shown below. 119 | ``` php 120 | $zoom = new \MacsiDigital\Zoom\Support\Entry($apiKey, $apiSecret, $tokenLife, $maxQueries, $baseUrl); 121 | ``` 122 | 123 | ### Working with models 124 | 125 | As noted we are aiming for functionality similar to Laravel, so most things that you can do in Laravel you can do here, with exception to any database specific functionality, as we are not using databases. 126 | 127 | ``` php 128 | $user = Zoom::user()->create([...]); 129 | 130 | $user = Zoom::user()->find(...); 131 | 132 | $users = Zoom::user()->all(); 133 | 134 | $meetings = Zoom::user()->find(...)->meetings; 135 | 136 | // Even this 137 | 138 | $user = Zoom::user()->find(...); 139 | $meeting = Zoom::meeting()->make([...]); 140 | $user->meetings()->save($meeting); 141 | ``` 142 | 143 | Each model may also have some custom functions where Zoom has some unique functionality. We try to list all this below, under Resources. 144 | 145 | ``` php 146 | $user = Zoom::user()->create([...]); 147 | 148 | $user->updateProfilePicture($image); // Path to image 149 | ``` 150 | 151 | ### Common get functions 152 | 153 | #### First 154 | 155 | We utilise the first function to return the first record from the record set. This will return an instantiated model. 156 | 157 | ``` php 158 | $user = Zoom::user()->where('status', 'active')->first(); 159 | ``` 160 | 161 | #### Find 162 | 163 | We utilise the find function to return a record by searching for it by a unique attribute. This will return an instantiated model. 164 | 165 | ``` php 166 | $user = Zoom::user()->find('id'); 167 | 168 | //or 169 | 170 | $user = Zoom::user()->find('email@address.com'); 171 | 172 | // for most models this is only the id. The past models utilise the uuid instead of the id. 173 | ``` 174 | 175 | #### All 176 | 177 | The find all function returns a customised Laravel Collection, which we call a resultset. 178 | 179 | ``` php 180 | $users = Zoom::user()->all(); 181 | ``` 182 | 183 | When calling the all function we will make up to 5 API calls to retrieve all the data, so 5 x 300 records (the max allowed), i.e. up to 1500 records per request. This can be amended in the config by updating 'max_api_calls_per_request'. 184 | 185 | More info below in ResultSets. 186 | 187 | #### Get 188 | 189 | We utilise the get function when we want to retrieve filtered records. Note that Zoom doesn't offer much in the way of filters. So check the documentation. 190 | 191 | ``` php 192 | $users = Zoom::user()->where('status', 'active')->get(); 193 | 194 | // We can also pass 195 | 196 | $users = Zoom::user()->where('status', '=', 'active')->get(); 197 | ``` 198 | 199 | When using the get call we will automatically paginate results, which by default is 30 records. You can increase/decrease this by calling the paginate function. 200 | 201 | ``` php 202 | $users = Zoom::user()->where('status', 'active')->paginate(100)->get(); // will return 100 records 203 | ``` 204 | 205 | You can disable the pagination, so it behaves the same as the all() function 206 | 207 | ``` php 208 | $users = Zoom::user()->where('status', 'active')->setPaginate(false)->setPerPage(300)->get(); // will return 300 records * 5 request (or amount set in config) = 1500 records 209 | ``` 210 | 211 | #### resultSet 212 | 213 | The all and get functions return a resultSet which is an enhanced Laravel Collection. Like collections, we can call the toArray and toJson functions, which places the data in a 'data' field and adds some meta information on total records and page information. 214 | 215 | ``` php 216 | // toArray() 217 | array:5 [ 218 | "current_page" => 1 219 | "data" => array:5 [ 220 | 0 => array:11 [ 221 | "uuid" => "...." 222 | "id" => .... 223 | "host_id" => "...." 224 | "topic" => "Team managers meeting" 225 | "type" => 2 226 | "start_time" => "2020-05-09T14:00:00+00:00" 227 | "duration" => 180 228 | "timezone" => "Europe/London" 229 | "created_at" => "2020-05-09T12:34:23+00:00" 230 | "join_url" => "https://zoom.us/j/...." 231 | "user_id" => "...." 232 | ] 233 | 1 => array:11 [ 234 | "uuid" => "...." 235 | "id" => .... 236 | "host_id" => "...." 237 | "topic" => "Onboarding meeting with Rosie Doe" 238 | "type" => 2 239 | "start_time" => "2020-05-10T13:30:00+00:00" 240 | "duration" => 180 241 | "timezone" => "Europe/London" 242 | "created_at" => "2020-05-10T13:19:41+00:00" 243 | "join_url" => "https://zoom.us/j/...." 244 | "user_id" => "...." 245 | ] 246 | 2 => array:11 [ 247 | "uuid" => "...." 248 | "id" => .... 249 | "host_id" => "...." 250 | "topic" => "Property tracking application meeting" 251 | "type" => 2 252 | "start_time" => "2020-05-14T15:30:00+00:00" 253 | "duration" => 60 254 | "timezone" => "Europe/London" 255 | "created_at" => "2020-05-14T08:45:32+00:00" 256 | "join_url" => "https://zoom.us/j/...." 257 | "user_id" => "...." 258 | ] 259 | 3 => array:11 [ 260 | "uuid" => "...." 261 | "id" => .... 262 | "host_id" => "...." 263 | "topic" => "Marketing meeting with John Doe" 264 | "type" => 2 265 | "start_time" => "2020-05-22T09:30:00+00:00" 266 | "duration" => 60 267 | "timezone" => "Europe/London" 268 | "created_at" => "2020-05-22T08:11:06+00:00" 269 | "join_url" => "https://zoom.us/j/...." 270 | "user_id" => "...." 271 | ] 272 | 4 => array:11 [ 273 | "uuid" => "...." 274 | "id" => .... 275 | "host_id" => "...." 276 | "topic" => "New Meeting Test" 277 | "type" => 2 278 | "start_time" => "2020-05-28T16:00:00+00:00" 279 | "duration" => 60 280 | "timezone" => "Europe/London" 281 | "created_at" => "2020-05-26T14:38:15+00:00" 282 | "join_url" => "https://zoom.us/j/...." 283 | "user_id" => "...." 284 | ] 285 | ] 286 | "last_page" => 1 287 | "per_page" => 1500 288 | "total" => 5 289 | ] 290 | 291 | ``` 292 | 293 | There are a few additional helper functions. 294 | 295 | If our data set is larger than the returned records then we call the nextPage() function to return the next page of records. 296 | 297 | ```php 298 | $meetings->nextPage(); 299 | ``` 300 | 301 | We can then also navigate back a page by calling the previousPage() function. When doing this we will return cached results rather than querying the API. 302 | 303 | ```php 304 | $meetings->previousPage(); 305 | ``` 306 | 307 | There is also a function to accumulate more records, if you call the getNextRecords() function it will retrieve the next 1500 results and add them to the current records, so you can then run through 3000 records if required. 308 | 309 | ```php 310 | $meetings->getNextRecords(); 311 | ``` 312 | 313 | It is not advisable to mix the page navigation with the accumulating records function. 314 | 315 | There are also a number of helper functions. 316 | 317 | ```php 318 | $meetings->hasMorePages(); 319 | $meetings->isFirstPage(); 320 | $meetings->totalRecords(); 321 | $meetings->currentPage(); 322 | $meetings->lastPage(); 323 | $meetings->nextPageNumber(); 324 | $meetings->previousPageNumber(); 325 | $meetings->firstPage(); // returns first page number which in this case will always be 1 326 | $meetings->perPage(); // returns how many results we return per page 327 | ``` 328 | 329 | As noted above we are using collections as the base for the record sets, so anything that is possible in collections is possible here. As Zoom's ability to filter is limited we can use the collections 'where' function for example. 330 | 331 | ### Persisting Models 332 | 333 | Again, the aim is to be similar to laravel, so you can utilise the save, create, update and make methods. 334 | 335 | #### Save 336 | 337 | To save a model we will use the save method, this will determine if the model is a new model or an existing and insert or update the model as needed. 338 | 339 | ``` php 340 | $user = Zoom::user()->find('id'); 341 | 342 | $user->first_name = 'changed'; 343 | 344 | $user->save(); 345 | ``` 346 | 347 | #### Create 348 | 349 | Currently, only the User model and Role model can be created directly, most other models need to be created as part of a relationship, see below for details. 350 | 351 | To create a user. 352 | 353 | ``` php 354 | Zoom::user()->create([ 355 | 'first_name' => 'First Name', 356 | 'last_name' => 'Last Name', 357 | 'email' => 'test@test.com', 358 | 'password' => 'secret' 359 | ]); 360 | // will return the created model so you can capture it if required. 361 | $user = Zoom::user()->create([ 362 | 'first_name' => 'First Name', 363 | 'last_name' => 'Last Name', 364 | 'email' => 'test@test.com', 365 | 'password' => 'secret' 366 | ]); 367 | ``` 368 | 369 | #### Make 370 | 371 | Make is similar to create except it will not persist the model to the API. This is handy for relationship models, more on this below. 372 | 373 | ``` php 374 | $meeting = Zoom::meeting()->make([...]); 375 | 376 | Zoom::user()->find('id')->meetings()->save($meeting); 377 | ``` 378 | 379 | #### Update 380 | 381 | We can also mass update attributes. 382 | 383 | ``` php 384 | $user = Zoom::user()->find('id')->update(['field' => 'value', 'another_field' => 'value']); 385 | ``` 386 | 387 | ### Relationships 388 | 389 | A major change to the newer versions of our API client is we use Relationships similar to Laravel. To retrieve all meetings associated to a user we would call like so. 390 | 391 | ```php 392 | $meetings = Zoom::user()->find(...)->meetings; 393 | ``` 394 | 395 | In the Zoom API some relationships get returned direct with the parent model, some we have to make additional API calls for (this is worthwhile knowing for performance reasons and API rate limits). 396 | 397 | Its also worth pointing out that we are returning the resultset by calling ->meetings. If we call the function ->meetings() we receive the relationship object which can be further queried. 398 | 399 | ```php 400 | $meetings = Zoom::user()->find(...)->settings(); // Returns HasOne relationship model 401 | 402 | $meetings = Zoom::user()->find(...)->meetings(); // Returns HasMany relationship model 403 | ``` 404 | 405 | The later is handy when we need to filter results 406 | 407 | ```php 408 | $meetings = Zoom::user()->find(...)->meetings()->where('type', 'scheduled')->get(); 409 | ``` 410 | 411 | As noted above, Zoom has very limited queryable filters, so check with the Zoom documentation. 412 | 413 | #### Save & Create 414 | 415 | We can utilise the create and save functions on the relationship model to create models that require a relationship. 416 | 417 | ``` php 418 | // Save Method 419 | 420 | $meeting = Zoom::meeting()->make([...]); 421 | Zoom::user()->find('id')->meetings()->save($meeting); 422 | 423 | // Create Method 424 | 425 | Zoom::user()->find('id')->meetings()->create([...]); 426 | ``` 427 | 428 | We can also utilise the Make and Attach methods for creating and attaching models to a parent without persisting the model. This is handy for attaching sub models that need to save as part of the parent. 429 | 430 | ``` php 431 | // Create Method 432 | 433 | $meeting = Zoom::user()->find('id')->meetings()->make([...]); 434 | 435 | $meeting->recurrence()->make([...]); // will attach to parent but not persist 436 | 437 | $meeting->save() // will save meeting and the attached recurrence model. 438 | 439 | // Attach Method 440 | 441 | $meeting = Zoom::meeting()->create([...]); 442 | 443 | $recurrence = Zoom::meeting()->recurrence()->make([...]); 444 | $meeting->attach($recurrence); // will attach to parent but not persist 445 | 446 | $meeting->save() // will save meeting and the attached recurrence model. 447 | 448 | // The later is very uncommon in Zoom and unlikely to be used due to the setup of relationships, but is an option. 449 | ``` 450 | 451 | ### Validation 452 | 453 | Validation is built into the API where possible, and will throw an exception if there are validation errors. If our own validation fails and the Zoom request returns an error, then we will throw a HTTP exception. 454 | 455 | If Validation in the API changes or something is not working, then the best is to amend the request object for the failing model and submit a pull request. 456 | 457 | ### Resources 458 | 459 | We give a brief overview of the common models, we have not included any validation requirements, you will need to check documentation for this. 460 | 461 | #### Roles 462 | 463 | ``` php 464 | //To get a new instance 465 | 466 | Zoom::role(); 467 | 468 | // available retrieve functions 469 | 470 | $role->find($id); // by id 471 | $role->all(); 472 | $role->get(); 473 | $role->first(); 474 | 475 | // No available queries 476 | 477 | // Relationships 478 | $role->members // HasMany relationship, returns all users with role 479 | $role->privileges // hasOne relationship, list of all privileges 480 | 481 | // Special functions 482 | 483 | // Assign and remove role from users 484 | $role->giveRoleTo($user) 485 | $role->removeRoleFrom($user) 486 | 487 | // delete 488 | $role->delete(); // Delete (destroy) role. 489 | ``` 490 | 491 | #### Users 492 | 493 | This is the main access for most models in Zoom. 494 | 495 | ``` php 496 | //To get a new instance 497 | 498 | Zoom::user(); 499 | 500 | // available retrieve functions 501 | 502 | Zoom::user()->find('test@example.com'); // by id or email 503 | Zoom::user()->all(); 504 | Zoom::user()->get(); 505 | Zoom::user()->first(); 506 | 507 | // Available queries 508 | 509 | Zoom::user()->where('type', 'active')->get(); // Allowed values active, inactive and pending 510 | Zoom::user()->where('role_id', *id*)->get(); // Allowed values are from the Roles model. 511 | 512 | // Relationships 513 | $user->setting // HasOne relationship 514 | $user->meetings // HasMany relationship 515 | $user->webinars // HasMany relationship 516 | $user->assistants // hasMany relationship 517 | $user->schedulers // hasMany relationship 518 | $user->permission // hasOne relationship 519 | $user->token // hasOne relationship 520 | $user->recordings // hasMany relationship 521 | 522 | // Special functions 523 | 524 | // To set license type 525 | $user->setBasic() 526 | $user->setLicensed() 527 | $user->setOnPrem() 528 | 529 | // Update functions 530 | $user->updateProfilePicture($image) // should pass the path to the image 531 | $user->updateStatus($status); // Allowed values active, deactivate 532 | $user->updatePassword($password); 533 | $user->updateEmail($email); 534 | 535 | // disassociate & delete 536 | $user->disassociate(); // Disassociate from current account, user can still login to their own account. 537 | $user->delete(); // Delete (destroy) user. 538 | ``` 539 | 540 | ##### User Settings 541 | 542 | ``` php 543 | //To get a new instance 544 | 545 | Zoom::setting(); 546 | 547 | // can only be retrieved through a user 548 | 549 | $user->settings; 550 | 551 | // To get sub relations then call the relationship of the setting 552 | 553 | $user->settings->scheduleMeeting; 554 | $user->settings->emailNotification; 555 | $user->settings->feature; 556 | $user->settings->inMeeting; 557 | $user->settings->integration; 558 | $user->settings->recording; 559 | $user->settings->telephony; 560 | $user->settings->tsp; 561 | 562 | // To update a setting 563 | 564 | $settings = $user->settings; 565 | $settings->scheduleMeeting->host_video = false; 566 | $settings->save(); 567 | 568 | // Available queries 569 | 570 | $user()->settings()->where('login_type', '0')->get(); // Allowed values 0 => facebook, 1 => google, 99 => API, 100 => Zoom, 101 => SSO 571 | // Below not yet setup 572 | // $user()->settings()->where('option', 'meeting_authentication')->get(); // Allowed values meeting_authentication, recording_authentication. 573 | ``` 574 | 575 | #### Meetings 576 | 577 | ``` php 578 | //To get a new instance 579 | 580 | $meeting = Zoom::meeting(); 581 | 582 | // To create we have to go through a user model 583 | 584 | $meeting = Zoom::user()->find(id)->meetings()->create([...]); 585 | 586 | $meeting = Zoom::meeting()->make([...]); 587 | $user = Zoom::user()->find(id)->meetings()->save($meeting); 588 | 589 | // To create a recurring meeting, this is just an example, you need to consult documentation to get the settings you require 590 | 591 | $meeting = Zoom::meeting()->make([ 592 | 'topic' => 'New meeting', 593 | 'type' => 8, 594 | 'start_time' => new Carbon('2020-08-12 10:00:00'), // best to use a Carbon instance here. 595 | ]); 596 | 597 | $meeting->recurrence()->make([ 598 | 'type' => 2, 599 | 'repeat_interval' => 1, 600 | 'weekly_days' => 2, 601 | 'end_times' => 5 602 | ]); 603 | 604 | $meeting->settings()->make([ 605 | 'join_before_host' => true, 606 | 'approval_type' => 1, 607 | 'registration_type' => 2, 608 | 'enforce_login' => false, 609 | 'waiting_room' => false, 610 | ]); 611 | 612 | $user->meetings()->save($meeting); 613 | 614 | // To retrieve multiple records we need to go through the user model 615 | 616 | $user->meetings()->all(); 617 | $user->meetings; // same as above 618 | $user->meetings()->get(); 619 | $user->meetings()->first(); 620 | 621 | // available retrieve functions 622 | 623 | $meeting->find(id); // by id 624 | 625 | // We can update direct 626 | 627 | Zoom::meeting()->find(id)->update([...]); 628 | 629 | // or by using save function 630 | // 631 | $meeting->save(); 632 | 633 | // Available queries 634 | 635 | $user->meetings()->where('type', 'scheduled')->get(); // Allowed values scheduled, live and upcoming 636 | 637 | // Relationships 638 | $meeting->registrants // HasMany relationship 639 | $meeting->setting // HasOne relationship 640 | $meeting->invitation // HasOne relationship 641 | $meeting->occurrences // hasMany relationship 642 | $meeting->recurrence // hasOne relationship 643 | $meeting->polls // hasMany relationship 644 | $meeting->liveStream // hasOne relationship 645 | $meeting->registrationQuestions // hasMany relationship 646 | $meeting->trackingFields // hasMany relationship 647 | $meeting->recording // hasOne relationship 648 | 649 | // Once we have the meeting we can update registrants 650 | 651 | $registrant = Zoom::meeting()->registrants()->create([...]); 652 | 653 | // or 654 | 655 | $registrant = Zoom::meetingRegistrant()->make([...]); 656 | $meeting->registrants()->save($registrant); 657 | 658 | // To retrieve occurrences, Zoom requires both meeting and occurrence ID's, so we have to 659 | // first retrieve the meeting 660 | 661 | $occurrence = Zoom::meeting()->find('...')->occurrences()->find('...'); 662 | 663 | // You can then register people to that occurrence 664 | 665 | $registrant = Zoom::meetingRegistrant()->make([...]); 666 | 667 | $occurrence->registrants()->save($registrant); 668 | 669 | // Special functions 670 | 671 | // End Meeting 672 | $meeting->endMeeting(); 673 | 674 | // delete 675 | $meeting->delete($scheduleForReminder); // Delete (destroy) meeting. ScheduleForReminder true by default 676 | 677 | //Delete Meeting Recording 678 | $meeting->recording->delete(); //Delete (destroy) the recording of the meeting. 679 | ``` 680 | 681 | #### Webinars 682 | 683 | ``` php 684 | //To get a new instance 685 | 686 | $webinar = Zoom::webinar(); 687 | 688 | // To create we have to go through a user model 689 | 690 | $webinar = Zoom::user()->find(id)->webinars()->create([...]); 691 | 692 | $webinar = Zoom::webinar()->make([...]); 693 | $user = Zoom::user()->find(id)->webinars()->save($webinar); 694 | 695 | // To create a recurring meeting, this is just an example, you need to consult documentation to get the settings you require 696 | 697 | $webinar = Zoom::webinar()->make([ 698 | 'topic' => 'New webinar', 699 | 'type' => 8, 700 | 'start_time' => new Carbon('2020-08-12 10:00:00'), // best to use a Carbon instance here. 701 | ]); 702 | 703 | $webinar->recurrence()->make([ 704 | 'type' => 2, 705 | 'repeat_interval' => 1, 706 | 'weekly_days' => 2, 707 | 'end_times' => 5 708 | ]); 709 | 710 | $webinar->settings()->make([ 711 | 'approval_type' => 1, 712 | 'registration_type' => 2, 713 | 'enforce_login' => false, 714 | ]); 715 | 716 | $user->webinars()->save($webinar); 717 | 718 | // To retrieve multiple records we need to go through the user model 719 | 720 | $user->webinars()->all(); 721 | $user->webinars; // same as above 722 | $user->webinars()->get(); 723 | $user->webinars()->first(); 724 | 725 | // available retrieve functions 726 | 727 | $webinar->find(id); // by id 728 | 729 | // We can update direct 730 | 731 | Zoom::webinar()->find(id)->update([...]); 732 | 733 | // or use the save function 734 | 735 | $webinar->save(); 736 | 737 | // Relationships 738 | $webinar->registrants // HasMany relationship 739 | $webinar->panelists // HasMany relationship 740 | $webinar->setting // HasOne relationship 741 | $webinar->invitation // HasOne relationship 742 | $webinar->occurrences // hasMany relationship 743 | $webinar->recurrence // hasOne relationship 744 | $webinar->polls // hasMany relationship 745 | $webinar->registrationQuestions // hasMany relationship 746 | $webinar->trackingSources // hasMany relationship 747 | $webinar->trackingFields // hasMany relationship 748 | 749 | // To retrieve an occurrence, Zoom requires both webinar and occurnce ID's, so we have to 750 | // first retrieve the webinar 751 | 752 | $occurrence = Zoom::webinar()->find('...')->occurrences()->find('...'); 753 | 754 | // You can retrieve all occurrences 755 | 756 | $occurrence = Zoom::webinar()->find('...')->occurrences; 757 | 758 | // Once we have the webinar we can update registrants / panelists 759 | 760 | $registrant = Zoom::webinarRegistrant()->create([...]); 761 | 762 | $webinar->registrants()->save($registrant); 763 | 764 | $registrant = Zoom::panelist()->create([...]); 765 | 766 | $webinar->panelists()->save($panelist); 767 | 768 | // Special functions 769 | 770 | // End Webinar 771 | $webinar->endWebinar() 772 | 773 | // delete 774 | $webinar->delete(); // Delete (destroy) webinar. 775 | ``` 776 | 777 | #### Meeting/Webinar Occurrences 778 | 779 | We are showing info for meeting, you will need to switch out meeting to webinar for webinars. 780 | 781 | ``` php 782 | // cant be instantiated or created directly, has to be created by setting up a recurrence 783 | // model on Meeting/Webinar Creation 784 | // 785 | // To retrieve occurrences we need to go through the meeting/webinar model, 786 | // 787 | // Only try to retrieve for a meeting/webinar that recurs, otherwise you will just get returned a 788 | // meeting/webinar model which will throw an error. 789 | 790 | $meeting->occurrences; // returns MeetingOccurrence model / WebinarOccurrences model 791 | 792 | // To get an occurrence 793 | 794 | $occurrence = $meeting->occurrences()->find(*id*); // Returns an Occurence model 795 | 796 | // Once we have the recurrence we can update registrants / panelists to that occurrence instance 797 | 798 | $registrant = Zoom::meetingRegistrant()->create([...]); 799 | 800 | $occurrence->registrants()->save($registrant); 801 | 802 | // Relationships 803 | $occurrence->registrants // HasMany relationship (meeting only) 804 | 805 | // An occurrence can also be updated directly 806 | $occurrence->save(); // update only, can't be created directly. 807 | 808 | // Single occurrences can also be deleted 809 | $occurrence->delete(); 810 | ``` 811 | 812 | #### Meeting/Webinar Settings 813 | 814 | We are showing info for meeting, you will need to switch out meeting to webinar for webinars. 815 | 816 | ``` php 817 | //To get a new instance 818 | 819 | $settings = Zoom::meetingSetting(); 820 | 821 | // To create we have to go through a meeting model 822 | 823 | $setting = $meeting->settings()->create([...]); 824 | 825 | $settings = Zoom::meetingSetting()->make([...]); 826 | $meeting = $meeting->settings()->save($settings); 827 | 828 | // To retrieve settings we need to go through the meeting model 829 | 830 | $meeting->settings; // returns MeetingSetting model / WebinarSettings model 831 | 832 | // Relationships 833 | $setting->globalDialInNumbers // HasMany relationship (meeting only) 834 | $setting->globalDialInCountries // HasMany relationship 835 | ``` 836 | 837 | #### Past Meetings 838 | 839 | Coming soon 840 | 841 | 842 | #### Past Webinars 843 | 844 | Coming soon 845 | 846 | ## To Do's 847 | 848 | - Documentation Site 849 | - Documentation for other Meeting/Webinar relationships 850 | - Documentation for Past Meetings & Past Webinars 851 | - OAuth2 implementation 852 | - Tests 853 | 854 | ## Changelog 855 | 856 | Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. 857 | 858 | ## Contributing 859 | 860 | Please see [CONTRIBUTING](CONTRIBUTING.md) for details. 861 | 862 | ## Security 863 | 864 | If you discover any security-related issues, please email [info@macsi.co.uk](mailto:info@macsi.co.uk) instead of using the issue tracker. 865 | 866 | ## Credits 867 | 868 | - [Colin Hall](https://github.com/colinhall17) 869 | - [MacsiDigital](https://github.com/MacsiDigital) 870 | - [All Contributors](../../contributors) 871 | 872 | ## License 873 | 874 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 875 | -------------------------------------------------------------------------------- /UPGRADE.md: -------------------------------------------------------------------------------- 1 | # Upgrade Guide 2 | 3 | ## Config File 4 | 5 | ### Likelihood of impact - High 6 | 7 | In the config file we now by default use ZOOM_CLIENT_KEY and ZOOM_CLIENT_SECRET, v1 we used ZOOM_CLIENT and ZOOM_SECRET, you will need to update your .env file or change the vendor published config file. -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "macsidigital/laravel-zoom", 3 | "description": "Laravel Zoom package", 4 | "homepage": "https://github.com/MacsiDigital/laravel-zoom", 5 | "keywords": [ 6 | "macsidigital", 7 | "laravel-zoom", 8 | "zoom", 9 | "laravel", 10 | "api", 11 | "client" 12 | ], 13 | "license": "MIT", 14 | "type": "library", 15 | "authors": [ 16 | { 17 | "name": "Colin Hall", 18 | "email": "colin@macsi.co.uk", 19 | "role": "Developer" 20 | } 21 | ], 22 | "require": { 23 | "php": "^8.0|^8.1", 24 | "illuminate/support": "^8.0|^9.0|^10.0", 25 | "macsidigital/laravel-api-client": "^5.0" 26 | }, 27 | "require-dev": { 28 | "friendsofphp/php-cs-fixer": "^2.16|^3.14", 29 | "orchestra/testbench": "^6.0|^7.0|^8.0", 30 | "phpunit/phpunit": "^9.0" 31 | }, 32 | "autoload": { 33 | "psr-4": { 34 | "MacsiDigital\\Zoom\\": "src" 35 | } 36 | }, 37 | "autoload-dev": { 38 | "psr-4": { 39 | "MacsiDigital\\Zoom\\Tests\\": "tests" 40 | } 41 | }, 42 | "scripts": { 43 | "test": "vendor/bin/phpunit", 44 | "test-coverage": "vendor/bin/phpunit --coverage-html coverage", 45 | "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes" 46 | }, 47 | "config": { 48 | "sort-packages": true 49 | }, 50 | "extra": { 51 | "laravel": { 52 | "providers": [ 53 | "MacsiDigital\\Zoom\\Providers\\ZoomServiceProvider" 54 | ], 55 | "aliases": { 56 | "Zoom": "MacsiDigital\\Zoom\\Facades\\Zoom" 57 | } 58 | } 59 | }, 60 | "minimum-stability": "dev", 61 | "prefer-stable": true 62 | } 63 | -------------------------------------------------------------------------------- /config/config.php: -------------------------------------------------------------------------------- 1 | env('ZOOM_ACCOUNT_ID'), 5 | 'client_id' => env('ZOOM_CLIENT_ID'), 6 | 'client_secret' => env('ZOOM_CLIENT_SECRET'), 7 | 'cache_token' => env('ZOOM_CACHE_TOKEN', true), 8 | 'base_url' => 'https://api.zoom.us/v2/', 9 | 'authentication_method' => 'Oauth', // Only Oauth compatible at present 10 | 'max_api_calls_per_request' => '5' // how many times can we hit the api to return results for an all() request 11 | ]; 12 | -------------------------------------------------------------------------------- /psalm.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Absentees.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 21 | } 22 | 23 | public function getApiMultipleDataField() 24 | { 25 | return $this->apiMultipleDataField; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/AuthenticationOption.php: -------------------------------------------------------------------------------- 1 | hasOne(LiveStreamStatusSetting::class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/LiveStreamStatusSetting.php: -------------------------------------------------------------------------------- 1 | 'users/{user:id}/meetings', 16 | 'post' => 'users/{user:id}/meetings', 17 | ]; 18 | 19 | protected $allowedMethods = ['find', 'get', 'post', 'patch', 'delete']; 20 | 21 | protected $apiDataField = ''; 22 | 23 | protected $apiMultipleDataField = 'meetings'; 24 | 25 | protected $casts = [ 26 | 'start_time' => 'datetime', 27 | 'created_at' => 'datetime', 28 | ]; 29 | 30 | public function settings() 31 | { 32 | return $this->hasOne(MeetingSetting::class); 33 | } 34 | 35 | public function recurrence() 36 | { 37 | return $this->hasOne(Recurrence::class); 38 | } 39 | 40 | public function occurrences() 41 | { 42 | return $this->hasMany(MeetingOccurrence::class); 43 | } 44 | public function participants() 45 | { 46 | return $this->hasMany(MeetingParticipant::class); 47 | } 48 | public function registrants() 49 | { 50 | return $this->hasMany(MeetingRegistrant::class); 51 | } 52 | 53 | public function polls() 54 | { 55 | return $this->hasMany(Poll::class); 56 | } 57 | 58 | public function registrationQuestions() 59 | { 60 | return $this->hasMany(RegistrationQuestion::class); 61 | } 62 | 63 | public function invitation() 64 | { 65 | return $this->hasOne(Invitation::class); 66 | } 67 | 68 | public function liveStream() 69 | { 70 | return $this->hasOne(LiveStream::class); 71 | } 72 | 73 | public function trackingFields() 74 | { 75 | return $this->hasMany(TrackingField::class); 76 | } 77 | 78 | public function recording() 79 | { 80 | return $this->hasOne(MeetingRecording::class); 81 | } 82 | 83 | public function delete($scheduleForReminder = true) 84 | { 85 | return $this->newQuery()->addQuery('schedule_for_reminder', $scheduleForReminder)->delete(); 86 | } 87 | 88 | public function endMeeting() 89 | { 90 | return $this->newQuery()->sendRequest('put', ['meetings/'.$this->id.'/status', ['action' => 'end']])->successful(); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/MeetingOccurrence.php: -------------------------------------------------------------------------------- 1 | hasMany(MeetingRegistrant::class, 'meetings', 'meeting_id', ['occurrence_id' => $this->occurrence_id]); 24 | } 25 | 26 | public function getPatchEndPoint() 27 | { 28 | if ($this->hasCustomEndPoint('patch')) { 29 | return $this->getCustomEndPoint('patch').$this->getKeyForEndPoint(); 30 | } 31 | 32 | return $this->endPoint.'?occurrence_id='.$this->getKey(); 33 | } 34 | 35 | public function getDeleteEndPoint() 36 | { 37 | if ($this->hasCustomEndPoint('delete')) { 38 | return $this->getCustomEndPoint('delete').$this->getKeyForEndPoint(); 39 | } 40 | 41 | return $this->endPoint.'?occurrence_id='.$this->getKey(); 42 | } 43 | 44 | public function find($id) 45 | { 46 | $occurence = $this->newQuery()->addQuery('occurrence_id', $id)->getOne(); 47 | $occurence->meeting_id = $this->meeting_id; 48 | $occurence->occurrence_id = $id; 49 | 50 | return $occurence; 51 | } 52 | 53 | public function delete($scheduleForReminder = true) 54 | { 55 | return $this->newQuery()->addQuery('schedule_for_reminder', $scheduleForReminder)->delete(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/MeetingParticipant.php: -------------------------------------------------------------------------------- 1 | apiMultipleDataField; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/MeetingPasswordRequirement.php: -------------------------------------------------------------------------------- 1 | 'meetings/{meeting:id}/recordings', 11 | 'delete' => 'meetings/{meeting:id}/recordings', 12 | ]; 13 | 14 | protected $allowedMethods = ['get', 'delete']; 15 | 16 | public function recordingFiles() 17 | { 18 | return $this->hasMany(RecordingFile::class); 19 | } 20 | 21 | public function recordingPasswordRequirement() 22 | { 23 | return $this->hasOne(RecordingPasswordRequirement::class); 24 | } 25 | 26 | public function delete() 27 | { 28 | return $this->newQuery()->delete(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/MeetingRegistrant.php: -------------------------------------------------------------------------------- 1 | apiMultipleDataField; 20 | } 21 | 22 | public function customQuestions() 23 | { 24 | return $this->hasMany(CustomQuestion::class); 25 | } 26 | 27 | public function beforeQuery($query) 28 | { 29 | if (isset($this->occurrence_id)) { 30 | $query->addQuery('occurrence_id', $this->occurrence_id); 31 | } 32 | } 33 | 34 | public function beforeInsert($query) 35 | { 36 | if (isset($this->occurrence_id)) { 37 | $query->addQuery('occurrence_id', $this->occurrence_id); 38 | } 39 | } 40 | 41 | protected function updateAction($action) 42 | { 43 | if ($this->exists()) { 44 | if (isset($this->occurrence_id)) { 45 | return $this->newQuery()->sendRequest('put', ['meetings/'.$this->meeting_id.'/registrants/status', ['action' => $action, 'registrants' => [['id' => $this->id, 'email' => $this->email]]], ['occurrence_id' => $this->occurrence_id]])->successful(); 46 | } else { 47 | return $this->newQuery()->sendRequest('put', ['meetings/'.$this->meeting_id.'/registrants/status', ['action' => $action, 'registrants' => [['id' => $this->id, 'email' => $this->email]]]])->successful(); 48 | } 49 | } 50 | } 51 | 52 | public function approve() 53 | { 54 | return $this->updateAction('approve'); 55 | } 56 | 57 | public function deny() 58 | { 59 | return $this->updateAction('deny'); 60 | } 61 | 62 | public function cancel() 63 | { 64 | return $this->updateAction('cancel'); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/MeetingSetting.php: -------------------------------------------------------------------------------- 1 | hasMany(GlobalDialInNumber::class); 12 | } 13 | 14 | public function globalDialInCountries() 15 | { 16 | return $this->hasMany(GlobalDialInCountry::class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Panelist.php: -------------------------------------------------------------------------------- 1 | action = $action; 23 | 24 | return $this; 25 | } 26 | 27 | public function approve() 28 | { 29 | return $this->updateAction('approve'); 30 | } 31 | 32 | public function deny() 33 | { 34 | return $this->updateAction('deny'); 35 | } 36 | 37 | public function cancel() 38 | { 39 | return $this->updateAction('cancel'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Participant.php: -------------------------------------------------------------------------------- 1 | hasMany(Participant::class); 22 | } 23 | 24 | public function instances() 25 | { 26 | return $this->hasMany(Instance::class); 27 | } 28 | 29 | public function files() 30 | { 31 | return $this->hasMany(File::class, 'in_meeting_files'); 32 | } 33 | 34 | public function poll() 35 | { 36 | return $this->hasOne(PollResult::class); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/PastWebinar.php: -------------------------------------------------------------------------------- 1 | hasMany(Participant::class); 22 | } 23 | 24 | public function absentees() 25 | { 26 | return $this->hasMany(Absentees::class); 27 | } 28 | 29 | public function instances() 30 | { 31 | return $this->hasMany(Instance::class); 32 | } 33 | 34 | public function files() 35 | { 36 | return $this->hasMany(File::class, 'in_meeting_files'); 37 | } 38 | 39 | public function poll() 40 | { 41 | return $this->hasOne(PollResult::class); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Permission.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Poll.php: -------------------------------------------------------------------------------- 1 | apiMultipleDataField; 21 | } 22 | 23 | public function questions() 24 | { 25 | return $this->hasMany(PollQuestion::class); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/PollQuestion.php: -------------------------------------------------------------------------------- 1 | app->runningInConsole()) { 17 | $this->publishes([ 18 | __DIR__.'/../../config/config.php' => config_path('zoom.php'), 19 | ], 'config'); 20 | } 21 | } 22 | 23 | /** 24 | * Register services. 25 | * 26 | * @return void 27 | */ 28 | public function register() 29 | { 30 | // Automatically apply the package configuration 31 | $this->mergeConfigFrom(__DIR__.'/../../config/config.php', 'zoom'); 32 | 33 | // Register the main class to use with the facade 34 | $this->app->singleton('zoom', 'MacsiDigital\Zoom\Contracts\Zoom'); 35 | $this->app->bind('MacsiDigital\Zoom\Contracts\Zoom', 'MacsiDigital\Zoom\Support\Entry'); 36 | 37 | $this->app->bind('zoom.client', 'MacsiDigital\Zoom\Support\Client'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/QA.php: -------------------------------------------------------------------------------- 1 | 'users/{user:id}/recordings', 11 | ]; 12 | 13 | protected $allowedMethods = ['get']; 14 | 15 | protected $apiMultipleDataField = 'meetings'; 16 | 17 | public function recordingFiles() 18 | { 19 | return $this->hasMany(RecordingFile::class); 20 | } 21 | 22 | public function recordingPasswordRequirement() 23 | { 24 | return $this->hasOne(RecordingPasswordRequirement::class); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/RecordingFile.php: -------------------------------------------------------------------------------- 1 | belongsTo(Recording::class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/RecordingPasswordRequirement.php: -------------------------------------------------------------------------------- 1 | hasMany(Question::class); 22 | } 23 | 24 | public function customQuestions() 25 | { 26 | return $this->hasMany(CustomQuestion::class); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Requests/StoreAccount.php: -------------------------------------------------------------------------------- 1 | '', 11 | 'email' => 'nullable|email', 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /src/Requests/StoreCustomQuestion.php: -------------------------------------------------------------------------------- 1 | 'required|string', 11 | 'value' => 'required|string', 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /src/Requests/StoreEmailNotification.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "type" => "nullable|integer|in:0,1,2,3,4,5,6,7" 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /src/Requests/StoreGlobalDialInCountry.php: -------------------------------------------------------------------------------- 1 | "nullable|string", 11 | "country" => "nullable|string", 12 | "country_name" => "nullable|string", 13 | "number" => "nullable|string", 14 | "type" => "nullable|in:toll,tollfree", 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /src/Requests/StoreGlobalDialInNumber.php: -------------------------------------------------------------------------------- 1 | "nullable|string", 11 | "country" => "nullable|string", 12 | "country_name" => "nullable|string", 13 | "number" => "nullable|string", 14 | "type" => "nullable|in:toll,tollfree", 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /src/Requests/StoreMeeting.php: -------------------------------------------------------------------------------- 1 | 'nullable|string', 11 | 'type' => 'nullable|integer|in:1,2,3,8', 12 | 'start_time' => 'nullable|date', 13 | 'duration' => 'nullable|integer', 14 | 'timezone' => 'nullable|string', 15 | 'password' => 'nullable|string|max:10', 16 | 'schedule_for' => 'nullable|string', 17 | 'agenda' => 'nullable|string|max:2000', 18 | ]; 19 | 20 | protected $relatedResource = [ 21 | "settings" => StoreMeetingSetting::class, 22 | "recurrence" => StoreRecurrence::class, 23 | "tracking_fields" => StoreTrackingField::class, 24 | ]; 25 | } 26 | -------------------------------------------------------------------------------- /src/Requests/StoreMeetingSetting.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "participant_video" => "nullable|boolean", 12 | "cn_meeting" => "nullable|boolean", 13 | "in_meeting" => "nullable|boolean", 14 | "join_before_host" => "nullable|boolean", 15 | "mute_upon_entry" => "nullable|boolean", 16 | "watermark" => "nullable|boolean", 17 | "use_pmi" => "nullable|boolean", 18 | "approval_type" => "nullable|in:0,1,2", 19 | "registration_type" => "nullable|in:1,2,3", 20 | "audio" => "nullable|in:both,telephony,voip", 21 | "auto_recording" => "nullable|in:local,cloud,none", 22 | "enforce_login" => "nullable|boolean", 23 | "enforce_login_domains" => "nullable|string", 24 | "alternative_hosts" => "nullable|string", 25 | "close_registration" => "nullable|boolean", 26 | "waiting_room" => "nullable|boolean", 27 | "contact_name" => "nullable|string", 28 | "contact_email" => "nullable|string", 29 | "registrants_confirmation_email" => "nullable|boolean", 30 | "registrants_email_notification" => "nullable|boolean", 31 | "meeting_authentication" => "nullable|boolean", 32 | "authentication_option" => "nullable|string", 33 | "authentication_domains" => "nullable|string", 34 | "authentication_name" => "nullable|string", 35 | ]; 36 | 37 | protected $relatedResource = [ 38 | "global_dial_in_countries" => StoreGlobalDialInCountry::class, 39 | "global_dial_in_numbers" => StoreGlobalDialInNumber::class, 40 | ]; 41 | } 42 | -------------------------------------------------------------------------------- /src/Requests/StorePanelist.php: -------------------------------------------------------------------------------- 1 | "nullable|email", 11 | "name" => "required|string|max:64", 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /src/Requests/StorePoll.php: -------------------------------------------------------------------------------- 1 | 'nullable|string', 11 | ]; 12 | 13 | protected $relatedResource = [ 14 | "questions" => StorePollQuestion::class, 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /src/Requests/StorePollQuestion.php: -------------------------------------------------------------------------------- 1 | 'nullable|string', 11 | 'type' => 'nullable|in:single,multiple', 12 | 'answers' => 'nullable|array', 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /src/Requests/StoreQuestionAnswer.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "allow_submit_questions" => "nullable|boolean", 12 | "allow_anonymous_questions" => "nullable|boolean", 13 | "answer_questions" => "nullable|string|in:only,all", 14 | "attendees_can_comment" => "nullable|boolean", 15 | "attendees_can_upvote" => "nullable|boolean", 16 | "allow_auto_reply" => "nullable|string", 17 | "auto_reply_text" => "nullable|boolean", 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /src/Requests/StoreRecurrence.php: -------------------------------------------------------------------------------- 1 | "nullable|integer|in:1,2,3", 11 | "repeat_interval" => "nullable|integer", 12 | "weekly_days" => "nullable|string", 13 | "monthly_day" => "nullable|numeric|between:1,31", 14 | "monthly_week" => "nullable|numeric|in:-1,1,2,3,4", 15 | "monthly_week_day" => "nullable|integer|in:1,2,3,4,5,6,7", 16 | "end_times" => "nullable|numeric|max:50|exclude_unless:end_date_time,null", 17 | "end_date_time" => "nullable|date|exclude_unless:end_times,null", 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /src/Requests/StoreRegistrant.php: -------------------------------------------------------------------------------- 1 | "required|email", 11 | "first_name" => "required|string|max:64", 12 | "last_name" => "nullable|string|max:64", 13 | "address" => "nullable|string|max:64", 14 | "city" => "nullable|string|max:64", 15 | "country" => "nullable|string|max:64", 16 | "zip" => "nullable|string|max:20", 17 | "state" => "nullable|string|max:64", 18 | "phone" => "nullable|string|max:64", 19 | "industry" => "nullable|string|max:64", 20 | "org" => "nullable|string|max:64", 21 | "job_title" => "nullable|string|max:64", 22 | "purchasing_time_frame" => "nullable|string|in:Within a month,1-3 Months,4-6 Months,More than 6 months,More timeframe", 23 | "role_in_purchase_process" => "nullable|string|in:Decision Maker,Evaluator/Recommender,Influencer,Not involved", 24 | "no_of_employees" => "nullable|string|in:1-20,21-50,51-100,101-500,501-1,000,1,001-5,000,5,001-10,000,More than 10,000", 25 | "comments" => 'nullable|string|max:2000', 26 | "auto_approve" => 'nullable' 27 | ]; 28 | 29 | protected $relatedResource = [ 30 | "custom_questions" => StoreCustomQuestion::class, 31 | ]; 32 | } 33 | -------------------------------------------------------------------------------- /src/Requests/StoreRegistrantCustomQuestion.php: -------------------------------------------------------------------------------- 1 | "nullable|string", 11 | "value" => "nullable|string", 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /src/Requests/StoreRole.php: -------------------------------------------------------------------------------- 1 | 'required|string|max:128', 11 | 'description' => 'required|string|max:128', 12 | 'privileges' => 'required|array', 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /src/Requests/StoreTrackingField.php: -------------------------------------------------------------------------------- 1 | "nullable|string", 11 | "value" => "nullable|string", 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /src/Requests/StoreUser.php: -------------------------------------------------------------------------------- 1 | 'required|in:create,autoCreate,custCreate,ssoCreate', 11 | 'user_info.email' => 'required|email|max:128', 12 | 'user_info.type' => 'required|in:1,2,3', 13 | 'user_info.first_name' => 'nullable|string|max:64', 14 | 'user_info.last_name' => 'nullable|string|max:64', 15 | 'user_info.password' => 'nullable|between:8,32', 16 | ]; 17 | 18 | protected $mutateAttributes = [ 19 | 'email' => 'user_info.email', 20 | 'type' => 'user_info.type', 21 | 'first_name' => 'user_info.first_name', 22 | 'last_name' => 'user_info.last_name', 23 | 'password' => 'user_info.password', 24 | ]; 25 | } 26 | -------------------------------------------------------------------------------- /src/Requests/StoreWebinar.php: -------------------------------------------------------------------------------- 1 | 'nullable|string', 11 | 'type' => 'nullable|integer|in:5,6,9', 12 | 'start_time' => 'nullable|date', 13 | 'duration' => 'nullable|integer', 14 | 'timezone' => 'nullable|string', 15 | 'password' => 'nullable|string|max:10', 16 | 'agenda' => 'nullable|string|max:2000', 17 | ]; 18 | 19 | protected $relatedResource = [ 20 | "settings" => StoreWebinarSetting::class, 21 | "recurrence" => StoreRecurrence::class, 22 | "tracking_fields" => StoreTrackingField::class, 23 | ]; 24 | } 25 | -------------------------------------------------------------------------------- /src/Requests/StoreWebinarSetting.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "panelists_video" => "nullable|boolean", 12 | "practice_session" => "nullable|boolean", 13 | "hd_video" => "nullable|boolean", 14 | "approval_type" => "nullable|in:0,1,2", 15 | "registration_type" => "nullable|in:1,2,3", 16 | "audio" => "nullable|in:both,telephony,voip", 17 | "auto_recording" => "nullable|in:local,cloud,none", 18 | "enforce_login" => "nullable|boolean", 19 | "enforce_login_domains" => "nullable|string", 20 | "alternative_hosts" => "nullable|string", 21 | "close_registration" => "nullable|boolean", 22 | "show_share_button" => "nullable|boolean", 23 | "allow_multiple_devices" => "nullable|boolean", 24 | "on_demand" => "nullable|boolean", 25 | "contact_name" => "nullable|string", 26 | "contact_email" => "nullable|string", 27 | "registrants_restrict_number" => "nullable|numeric|max:20000", 28 | "post_webinar_survey" => "nullable|boolean", 29 | "survey_url" => "nullable|string", 30 | "registrants_email_notification" => "nullable|boolean", 31 | "meeting_authentication" => "nullable|boolean", 32 | "authentication_option" => "nullable|string", 33 | "authentication_domains" => "nullable|string", 34 | "authentication_name" => "nullable|string", 35 | "email_language" => "nullable|string", 36 | ]; 37 | 38 | protected $relatedResource = [ 39 | "global_dial_in_countries" => StoreGlobalDialInCountry::class, 40 | "attendees_and_panelists_reminder_email_notification" => StoreEmailNotification::class, 41 | "follow_up_absentees_email_notification" => StoreEmailNotification::class, 42 | "follow_up_attendees_email_notification" => StoreEmailNotification::class, 43 | "question_and_answer" => StoreQuestionAnswer::class, 44 | ]; 45 | } 46 | -------------------------------------------------------------------------------- /src/Requests/UpdateAccount.php: -------------------------------------------------------------------------------- 1 | '', 11 | 'email' => 'nullable|email', 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /src/Requests/UpdateCustomQuestion.php: -------------------------------------------------------------------------------- 1 | "nullable|string", 11 | "type" => "nullable|string|in:short,single", 12 | 'required' => 'nullable|boolean', 13 | 'answers' => 'nullable|array', 14 | ]; 15 | } 16 | -------------------------------------------------------------------------------- /src/Requests/UpdateEmailNotification.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "cancel_meeting_reminder" => "nullable|boolean", 12 | "alternative_host_reminder" => "nullable|boolean", 13 | "schedule_for_reminder" => "nullable|boolean", 14 | ]; 15 | } 16 | -------------------------------------------------------------------------------- /src/Requests/UpdateFeature.php: -------------------------------------------------------------------------------- 1 | "nullable|numeric", 11 | "large_meeting" => "nullable|boolean", 12 | "large_meeting_capacity" => "nullable|numeric", 13 | "webinar" => "nullable|boolean", 14 | "webinar_capacity" => "nullable|numeric", 15 | "zoom_phone" => "nullable|boolean", 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /src/Requests/UpdateGlobalDialInCountry.php: -------------------------------------------------------------------------------- 1 | "nullable|string", 11 | "country" => "nullable|string", 12 | "country_name" => "nullable|string", 13 | "number" => "nullable|string", 14 | "type" => "nullable|in:toll,tollfree", 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /src/Requests/UpdateGlobalDialInNumber.php: -------------------------------------------------------------------------------- 1 | "nullable|string", 11 | "country" => "nullable|string", 12 | "country_name" => "nullable|string", 13 | "number" => "nullable|string", 14 | "type" => "nullable|in:toll,tollfree", 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /src/Requests/UpdateInMeeting.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "chat" => "nullable|boolean", 12 | "private_chat" => "nullable|numeric", 13 | "auto_saving_chat" => "nullable|boolean", 14 | "entry_exit_chime" => "nullable|in:host,all,none", 15 | "record_play_voice" => "nullable|boolean", 16 | "feedback" => "nullable|boolean", 17 | "co_host" => "nullable|boolean", 18 | "polling" => "nullable|boolean", 19 | "attendee_on_hold" => "nullable|boolean", 20 | "show_meeting_control_toolbar" => "nullable|boolean", 21 | "annotation" => "nullable|boolean", 22 | "remote_control" => "nullable|boolean", 23 | "non_verbal_feedback" => "nullable|boolean", 24 | "breakout_room" => "nullable|boolean", 25 | "remote_support" => "nullable|boolean", 26 | "closed_caption" => "nullable|boolean", 27 | "group_hd" => "nullable|boolean", 28 | "virtual_background" => "nullable|boolean", 29 | "far_end_camera_control" => "nullable|boolean", 30 | "custom_data_center_regions" => "nullable|boolean", 31 | "waiting_room" => "nullable|boolean", 32 | "guest_only_to_place_in_waiting_room" => "nullable|boolean", 33 | "allow_live_streaming" => "nullable|boolean", 34 | "auto_admit_participants_with_specified_domains" => "nullable|boolean", 35 | "admit_participants_with_specified_domains" => "nullable|string", 36 | "workplace_by_facebook" => "nullable|boolean", 37 | "custom_live_streaming_service" => "nullable|boolean", 38 | "custom_service_instructions" => "nullable|string", 39 | "show_meeting_control_toolbar" => "nullable|boolean", 40 | "custom_data_center_regions" => "nullable|boolean", 41 | "data_center_regions" => "nullable|array", 42 | ]; 43 | } 44 | -------------------------------------------------------------------------------- /src/Requests/UpdateIntegration.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /src/Requests/UpdateLiveStream.php: -------------------------------------------------------------------------------- 1 | "required|string|max:1024", 11 | "stream_key" => "required|string|max:512", 12 | "page_url" => "nullable|string|max:1024", 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /src/Requests/UpdateLiveStreamStatus.php: -------------------------------------------------------------------------------- 1 | "required|in:start,stop", 11 | ]; 12 | 13 | protected $relatedResource = [ 14 | "settings" => UpdateLiveStreamStatusSetting::class, 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /src/Requests/UpdateLiveStreamStatusSetting.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "display_name" => "nullable|string|between:1,50", 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /src/Requests/UpdateMeeting.php: -------------------------------------------------------------------------------- 1 | 'nullable|string', 11 | 'type' => 'nullable|integer|in:1,2,3,8', 12 | 'start_time' => 'nullable|date', 13 | 'duration' => 'nullable|integer', 14 | 'timezone' => 'nullable|string', 15 | 'password' => 'nullable|string|max:10', 16 | 'schedule_for' => 'nullable|string', 17 | 'agenda' => 'nullable|string|max:2000', 18 | ]; 19 | 20 | protected $relatedResource = [ 21 | "settings" => UpdateMeetingSetting::class, 22 | "recurrence" => UpdateRecurrence::class, 23 | "tracking_fields" => UpdateTrackingField::class, 24 | ]; 25 | } 26 | -------------------------------------------------------------------------------- /src/Requests/UpdateMeetingPasswordRequirement.php: -------------------------------------------------------------------------------- 1 | "nullable|string|max:10", 11 | "have_letter" => "nullable|boolean", 12 | "have_number" => "nullable|boolean", 13 | "have_special_character" => "nullable|boolean", 14 | "only_allow_numeric" => "nullable|boolean", 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /src/Requests/UpdateMeetingSetting.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "participant_video" => "nullable|boolean", 12 | "cn_meeting" => "nullable|boolean", 13 | "in_meeting" => "nullable|boolean", 14 | "join_before_host" => "nullable|boolean", 15 | "mute_upon_entry" => "nullable|boolean", 16 | "watermark" => "nullable|boolean", 17 | "use_pmi" => "nullable|boolean", 18 | "approval_type" => "nullable|in:0,1,2", 19 | "registration_type" => "nullable|in:1,2,3", 20 | "audio" => "nullable|in:both,telephony,voip", 21 | "local_recording" => "nullable|in:local,cloud,none", 22 | "enforce_login" => "nullable|boolean", 23 | "enforce_login_domains" => "nullable|string", 24 | "alternative_hosts" => "nullable|string", 25 | "close_registration" => "nullable|boolean", 26 | "waiting_room" => "nullable|boolean", 27 | "contact_name" => "nullable|string", 28 | "contact_email" => "nullable|string", 29 | "registrants_confirmation_email" => "nullable|boolean", 30 | "registrants_email_notification" => "nullable|boolean", 31 | "meeting_authentication" => "nullable|boolean", 32 | "authentication_option" => "nullable|string", 33 | "authentication_domains" => "nullable|string", 34 | "authentication_name" => "nullable|string", 35 | ]; 36 | 37 | protected $relatedResource = [ 38 | "global_dial_in_countries" => UpdateGlobalDialInCountry::class, 39 | "global_dial_in_numbers" => UpdateGlobalDialInNumber::class, 40 | ]; 41 | } 42 | -------------------------------------------------------------------------------- /src/Requests/UpdateOccurrence.php: -------------------------------------------------------------------------------- 1 | 'nullable|date', 11 | 'duration' => 'nullable|integer', 12 | 'agenda' => 'nullable|string|max:2000', 13 | 'settings.host_video' => 'nullable|boolean', 14 | 'settings.panelists_video' => 'nullable|boolean', 15 | 'settings.hd_video' => 'nullable|boolean', 16 | 'settings.watermark' => 'nullable|boolean', 17 | 'settings.auto_recording' => 'nullable|boolean', 18 | 'settings.participant_video' => 'nullable|boolean', 19 | 'settings.join_before_host' => 'nullable|boolean', 20 | 'settings.mute_upon_entry' => 'nullable|boolean', 21 | 'settings.waiting_room' => 'nullable|boolean', 22 | ]; 23 | } 24 | -------------------------------------------------------------------------------- /src/Requests/UpdatePoll.php: -------------------------------------------------------------------------------- 1 | 'nullable|string', 11 | ]; 12 | 13 | protected $relatedResource = [ 14 | "questions" => UpdatePollQuestion::class, 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /src/Requests/UpdatePollQuestion.php: -------------------------------------------------------------------------------- 1 | 'nullable|string', 11 | 'type' => 'nullable|in:single,multiple', 12 | 'answers' => 'nullable|array', 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /src/Requests/UpdateQuestion.php: -------------------------------------------------------------------------------- 1 | "nullable|string|in:address,city,country,zip,state,phone,industry,org,job_title,purchasing_time_frame,role_in_purchase_process,no_of_employees,comments", 11 | "required" => "nullable|boolean", 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /src/Requests/UpdateRecording.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "cloud_recording" => "nullable|boolean", 12 | "record_speaker_view" => "nullable|boolean", 13 | "record_gallery_view" => "nullable|boolean", 14 | "record_audio_file" => "nullable|boolean", 15 | "save_chat_text" => "nullable|boolean", 16 | "show_timestamp" => "nullable|boolean", 17 | "recording_audio_transcript" => "nullable|boolean", 18 | "auto_recording" => "nullable|in:none,local,cloud", 19 | "auto_delete_cmr" => "nullable|boolean", 20 | "host_pause_stop_recording" => "nullable|boolean", 21 | "auto_delete_cmr_days" => "nullable|numeric|between:1,60", 22 | ]; 23 | 24 | protected $relatedResource = [ 25 | "recording_password_requirement" => UpdateRecordingPasswordRequirement::class, 26 | ]; 27 | } 28 | -------------------------------------------------------------------------------- /src/Requests/UpdateRecordingPasswordRequirement.php: -------------------------------------------------------------------------------- 1 | "nullable|string|max:10", 11 | "have_letter" => "nullable|boolean", 12 | "have_number" => "nullable|boolean", 13 | "have_special_character" => "nullable|boolean", 14 | "only_allow_numeric" => "nullable|boolean", 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /src/Requests/UpdateRecurrence.php: -------------------------------------------------------------------------------- 1 | "nullable|integer|in:1,2,3", 11 | "repeat_interval" => "nullable|integer", 12 | "weekly_days" => "nullable|string", 13 | "monthly_day" => "nullable|numeric|between:1,31", 14 | "monthly_week" => "nullable|numeric|in:-1,1,2,3,4", 15 | "monthly_week_day" => "nullable|integer|in:1,2,3,4,5,6,7", 16 | "end_times" => "nullable|numeric|max:50|exclude_unless:end_date_time,null", 17 | "end_date_time" => "nullable|date|exclude_unless:end_times,null", 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /src/Requests/UpdateRegistrationQuestion.php: -------------------------------------------------------------------------------- 1 | UpdateQuestion::class, 11 | "custom_questions" => UpdateCustomQuestion::class, 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /src/Requests/UpdateRole.php: -------------------------------------------------------------------------------- 1 | 'nullable|string|max:128', 11 | 'description' => 'nullable|string|max:128', 12 | 'privileges' => 'nullable|array', 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /src/Requests/UpdateScheduleMeeting.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "participants_video" => "nullable|boolean", 12 | "audio_type" => "nullable|in:both,telephony,voip,thirdParty", 13 | "join_before_host" => "nullable|boolean", 14 | "use_pmi_for_scheduled_meetings" => "nullable|boolean", 15 | "use_pmi_for_instant_meetings" => "nullable|boolean", 16 | "enforce_login_with_domains" => "nullable|boolean", 17 | "enforce_login_domains" => "nullable|boolean", 18 | "not_store_meeting_topic" => "nullable|boolean", 19 | "force_pmi_jbh_password" => "nullable|boolean", 20 | "require_password_for_instant_meetings" => "nullable|boolean", 21 | "require_password_for_pmi_meetings" => "nullable|in:jbh_only,all,none", 22 | "require_password_for_scheduling_new_meetings" => "nullable|boolean", 23 | 'require_password_for_scheduled_meetings' => "nullable|boolean", 24 | "pmi_password" => "nullable|string", 25 | "pstn_password_protected" => "nullable|boolean", 26 | "default_password_for_scheduled_meetings" => "nullable|string", 27 | "personal_meeting" => "nullable|boolean", 28 | ]; 29 | 30 | protected $relatedResource = [ 31 | "meeting_password_requirement" => UpdateMeetingPasswordRequirement::class, 32 | ]; 33 | } 34 | -------------------------------------------------------------------------------- /src/Requests/UpdateSetting.php: -------------------------------------------------------------------------------- 1 | UpdateEmailNotification::class, 11 | "feature" => UpdateFeature::class, 12 | "in_meeting" => UpdateInMeeting::class, 13 | "integration" => UpdateIntegration::class, 14 | "recording" => UpdateRecording::class, 15 | "schedule_meeting" => UpdateScheduleMeeting::class, 16 | "telephony" => UpdateTelephony::class, 17 | "tsp" => UpdateTsp::class, 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /src/Requests/UpdateTelephony.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "audio_conference_info" => "nullable|max:2048", 12 | "show_international_numbers_link" => "nullable|boolean", 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /src/Requests/UpdateTrackingField.php: -------------------------------------------------------------------------------- 1 | "nullable|string", 11 | "value" => "nullable|string", 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /src/Requests/UpdateTsp.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "call_out_countries" => "nullable|array", 12 | "show_international_numbers_link" => "nullable|boolean", 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /src/Requests/UpdateUser.php: -------------------------------------------------------------------------------- 1 | 'nullable|string|max:64', 11 | 'last_name' => 'nullable|string|max:64', 12 | 'type' => 'nullable|in:1,2,3', 13 | 'pmi' => 'nullable|size:10', 14 | 'use_pmi' => 'nullable|boolean', 15 | 'timezone' => '', 16 | 'language' => '', 17 | 'dept' => '', 18 | 'vanity_name' => '', 19 | 'host_key' => 'nullable|between:6,10', 20 | 'cms_user_id' => '', 21 | 'job_title' => 'nullable|max:128', 22 | 'company' => 'nullable|max:255', 23 | 'location' => 'nullable|max:256', 24 | 'phone_number' => '', 25 | 'phone_country' => '', 26 | ]; 27 | } 28 | -------------------------------------------------------------------------------- /src/Requests/UpdateWebinar.php: -------------------------------------------------------------------------------- 1 | 'nullable|string', 11 | 'type' => 'nullable|integer|in:5,6,9', 12 | 'start_time' => 'nullable|date', 13 | 'duration' => 'nullable|integer', 14 | 'timezone' => 'nullable|string', 15 | 'password' => 'nullable|string|max:10', 16 | 'agenda' => 'nullable|string|max:2000', 17 | ]; 18 | 19 | protected $relatedResource = [ 20 | "settings" => UpdateWebinarSetting::class, 21 | "recurrence" => UpdateRecurrence::class, 22 | "tracking_fields" => UpdateTrackingField::class, 23 | ]; 24 | } 25 | -------------------------------------------------------------------------------- /src/Requests/UpdateWebinarSetting.php: -------------------------------------------------------------------------------- 1 | "nullable|boolean", 11 | "panelist_video" => "nullable|boolean", 12 | "practice_video" => "nullable|boolean", 13 | "hd_video" => "nullable|boolean", 14 | "approval_type" => "nullable|in:0,1,2", 15 | "registration_type" => "nullable|in:1,2,3", 16 | "audio" => "nullable|in:both,telephony,voip", 17 | "auto_recording" => "nullable|in:local,cloud,none", 18 | "enforce_login" => "nullable|boolean", 19 | "enforce_login_domains" => "nullable|string", 20 | "alternative_hosts" => "nullable|string", 21 | "close_registration" => "nullable|boolean", 22 | "show_share_button" => "nullable|boolean", 23 | "allow_multiple_devices" => "nullable|boolean", 24 | "on_demand" => "nullable|boolean", 25 | "contact_name" => "nullable|string", 26 | "contact_email" => "nullable|string", 27 | "registrants_restrict_number" => "nullable|numeric|max:20000", 28 | "post_webinar_survey" => "nullable|boolean", 29 | "survey_url" => "nullable|string", 30 | "registrants_email_notification" => "nullable|boolean", 31 | "meeting_authentication" => "nullable|boolean", 32 | "authentication_option" => "nullable|string", 33 | "authentication_domains" => "nullable|string", 34 | "email_language" => "nullable|string", 35 | ]; 36 | 37 | protected $relatedResource = [ 38 | "global_dial_in_countries" => StoreGlobalDialInCountry::class, 39 | "attendees_and_panelists_reminder_email_notification" => StoreEmailNotification::class, 40 | "follow_up_absentees_email_notification" => StoreEmailNotification::class, 41 | "follow_up_attendees_email_notification" => StoreEmailNotification::class, 42 | "question_and_answer" => StoreQuestionAnswer::class, 43 | ]; 44 | } 45 | -------------------------------------------------------------------------------- /src/Role.php: -------------------------------------------------------------------------------- 1 | hasMany(User::class, 'members'); 23 | } 24 | 25 | public function giveRoleTo($user) 26 | { 27 | } 28 | 29 | public function removeRoleFrom($user) 30 | { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/ScheduleMeeting.php: -------------------------------------------------------------------------------- 1 | hasOne(MeetingPasswordRequirement::class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Scheduler.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 21 | } 22 | 23 | public function getApiMultipleDataField() 24 | { 25 | return $this->apiMultipleDataField; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Setting.php: -------------------------------------------------------------------------------- 1 | 'users/{user:id}/settings', 13 | ]; 14 | 15 | protected $allowedMethods = ['get', 'patch']; 16 | 17 | protected $apiMultipleDataField = ''; 18 | 19 | public function beforeSave($options, $query) 20 | { 21 | $this->exists = true; 22 | 23 | return $query; 24 | } 25 | 26 | public function user() 27 | { 28 | return $this->belongsTo(User::class); 29 | } 30 | 31 | public function emailNotification() 32 | { 33 | return $this->hasOne(EmailNotification::class); 34 | } 35 | 36 | public function feature() 37 | { 38 | return $this->hasOne(Feature::class); 39 | } 40 | 41 | public function inMeeting() 42 | { 43 | return $this->hasOne(InMeeting::class); 44 | } 45 | 46 | public function integration() 47 | { 48 | return $this->hasOne(Integration::class); 49 | } 50 | 51 | public function recording() 52 | { 53 | return $this->hasOne(Recording::class); 54 | } 55 | 56 | public function scheduleMeeting() 57 | { 58 | return $this->hasOne(ScheduleMeeting::class); 59 | } 60 | 61 | public function telephony() 62 | { 63 | return $this->hasOne(Telephony::class); 64 | } 65 | 66 | public function tsp() 67 | { 68 | return $this->hasOne(Tsp::class); 69 | } 70 | 71 | public function getApiMultipleDataField() 72 | { 73 | return $this->apiMultipleDataField; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/Support/Client.php: -------------------------------------------------------------------------------- 1 | accountId = $accountId ? $accountId : config('zoom.account_id'); 51 | $this->clientId = $clientId ? $clientId : config('zoom.client_id'); 52 | $this->clientSecret = $clientSecret ? $clientSecret : config('zoom.client_secret'); 53 | $this->maxQueries = $maxQueries ? $maxQueries : (config('zoom.max_api_calls_per_request') ? config('zoom.max_api_calls_per_request') : $this->maxQueries); 54 | $this->baseUrl = $baseUrl ? $baseUrl : config('zoom.base_url'); 55 | } 56 | 57 | public function newRequest() 58 | { 59 | if (strtolower(config('zoom.authentication_method')) == 'oauth') { 60 | return $this->oauthRequest(); 61 | } 62 | 63 | throw new \ErrorException( "authentication_method " . config('zoom.authentication_method') . ' not found'); 64 | } 65 | 66 | 67 | public function oauthRequest() 68 | { 69 | $cached = config('zoom.cache_token', true) ? \Cache::get('zoom_oauth_token') : null; 70 | $oauthToken = !is_null($cached) ? $cached : $this->OAuthGenerateToken(); 71 | 72 | return Client::baseUrl($this->baseUrl)->withToken($oauthToken); 73 | } 74 | 75 | private function OAuthGenerateToken(){ 76 | 77 | $response = \Illuminate\Support\Facades\Http::asForm() 78 | ->withHeaders([ 79 | 'Authorization' => ['Basic '.base64_encode("$this->clientId:$this->clientSecret")] 80 | ])->post('https://zoom.us/oauth/token', [ 81 | 'grant_type' => 'account_credentials', 82 | 'account_id' => $this->accountId, 83 | ]); 84 | 85 | if ($response->status() != 200) { 86 | throw new \ErrorException( $response['error']); 87 | } 88 | 89 | if(config('zoom.cache_token', true)) { 90 | // -10 seconds TTL just-in-case... 91 | cache(['zoom_oauth_token' => $response['access_token']], now()->addSeconds($response['expires_in'] - 10)); 92 | } 93 | 94 | return $response['access_token']; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/Support/Model.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/TrackingField.php: -------------------------------------------------------------------------------- 1 | 'create', 17 | 'type' => 1, 18 | ]; 19 | 20 | protected $endPoint = 'users'; 21 | 22 | protected $allowedMethods = ['find', 'get', 'post', 'patch', 'delete']; 23 | 24 | protected $apiDataField = ''; 25 | 26 | protected $apiMultipleDataField = 'users'; 27 | 28 | public function isBasicType() 29 | { 30 | $this->type = 1; 31 | 32 | return $this; 33 | } 34 | 35 | public function isLicensedType() 36 | { 37 | $this->type = 2; 38 | 39 | return $this; 40 | } 41 | 42 | public function isOnPremType() 43 | { 44 | $this->type = 3; 45 | 46 | return $this; 47 | } 48 | 49 | public function assistants() 50 | { 51 | return $this->hasMany(Assistant::class); 52 | } 53 | 54 | public function schedulers() 55 | { 56 | return $this->hasMany(Scheduler::class); 57 | } 58 | 59 | public function settings() 60 | { 61 | return $this->hasOne(Setting::class); 62 | } 63 | 64 | public function permission() 65 | { 66 | return $this->hasOne(Permission::class); 67 | } 68 | 69 | public function token() 70 | { 71 | return $this->hasOne(Token::class); 72 | } 73 | 74 | public function meetings() 75 | { 76 | return $this->hasMany(Meeting::class); 77 | } 78 | 79 | public function recordings() 80 | { 81 | return $this->hasMany(Recording::class); 82 | } 83 | 84 | public function webinars() 85 | { 86 | return $this->hasMany(Webinar::class); 87 | } 88 | 89 | public function setBasic() 90 | { 91 | $this->type = '1'; 92 | } 93 | 94 | public function setLicensed() 95 | { 96 | $this->type = '2'; 97 | } 98 | 99 | public function setOnPrem() 100 | { 101 | $this->type = '3'; 102 | } 103 | 104 | public function updateProfilePicture($image) 105 | { 106 | $filesize = number_format(filesize($image) / 1048576, 2); 107 | if ($filesize > 2) { 108 | throw new FileTooLargeException($image, $filesize, '2MB'); 109 | } else { 110 | return $this->newQuery()->attachFile('pic_file', file_get_contents($image), $image)->sendRequest('post', ['users/'.$this->id.'/picture'])->successful(); 111 | } 112 | } 113 | 114 | public function updateStatus($status) 115 | { 116 | if (in_array($status, ['activate', 'deactivate'])) { 117 | return $this->newQuery()->sendRequest('put', ['users/'.$this->id.'/status', ['action' => $status]])->successful(); 118 | } else { 119 | throw new ValidationException('Status must be either active or deactivate'); 120 | } 121 | } 122 | 123 | public function updatePassword($password) 124 | { 125 | if (strlen($password) >= 8) { 126 | return $this->newQuery()->sendRequest('put', ['users/'.$this->id.'/password', ['password' => $password]])->successful(); 127 | } else { 128 | throw new ValidationException('Password must be at least 8 characters'); 129 | } 130 | } 131 | 132 | public function updateEmail($email) 133 | { 134 | $validator = Validator::make(['email' => $email], [ 'email' => 'required|email|max:128' ]); 135 | if ($validator->fails()) { 136 | throw new ValidationException('Email must be a valid email address less than 128 characters'); 137 | } else { 138 | return $this->newQuery()->sendRequest('put', ['users/'.$this->id.'/email', ['email' => $email]])->successful(); 139 | } 140 | } 141 | 142 | public function disassociate() 143 | { 144 | return $this->newQuery()->sendRequest('delete', ['users/'.$this->id, ['action' => 'disassociate']])->successful(); 145 | } 146 | 147 | public function delete() 148 | { 149 | return $this->newQuery()->sendRequest('delete', ['users/'.$this->id, ['action' => 'delete']])->successful(); 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /src/Webinar.php: -------------------------------------------------------------------------------- 1 | 'users/{user_id}/webinars', 16 | 'post' => 'users/{user_id}/webinars', 17 | ]; 18 | 19 | protected $allowedMethods = ['find', 'get', 'post', 'patch', 'delete']; 20 | 21 | protected $apiDataField = ''; 22 | 23 | protected $apiMultipleDataField = 'webinars'; 24 | 25 | protected $casts = [ 26 | 'start_time' => 'datetime', 27 | 'created_at'=> 'datetime', 28 | ]; 29 | 30 | public function settings() 31 | { 32 | return $this->hasOne(WebinarSetting::class, 'settings'); 33 | } 34 | 35 | public function recurrence() 36 | { 37 | return $this->hasOne(Recurrence::class); 38 | } 39 | 40 | public function registrants() 41 | { 42 | return $this->hasMany(WebinarRegistrant::class); 43 | } 44 | public function participants() 45 | { 46 | return $this->hasMany(WebinarParticipant::class); 47 | } 48 | public function occurrences() 49 | { 50 | return $this->hasMany(WebinarOccurrence::class); 51 | } 52 | 53 | public function panelists() 54 | { 55 | return $this->hasMany(Panelist::class); 56 | } 57 | 58 | public function registrationQuestions() 59 | { 60 | return $this->hasMany(RegistrationQuestion::class); 61 | } 62 | 63 | public function trackingField() 64 | { 65 | return $this->hasMany(TrackingField::class); 66 | } 67 | 68 | public function trackingSources() 69 | { 70 | return $this->hasMany(TrackingSources::class); 71 | } 72 | 73 | public function polls() 74 | { 75 | return $this->hasMany(Poll::class); 76 | } 77 | 78 | public function endWebinar() 79 | { 80 | return $this->newQuery()->sendRequest('put', ['webinars/'.$this->id.'/status', ['action' => 'end']])->successful(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/WebinarOccurrence.php: -------------------------------------------------------------------------------- 1 | hasMany(WebinarRegistrant::class, 'webinars', 'webinar_id', ['occurrence_id' => $this->occurrence_id]); 24 | } 25 | 26 | public function find($id) 27 | { 28 | $occurence = $this->newQuery()->addQuery('occurrence_id', $id)->find($this->webinar_id); 29 | $occurence->webinar_id = $this->webinar_id; 30 | $occurence->occurrence_id = $id; 31 | 32 | return $occurence; 33 | } 34 | 35 | public function getPatchEndPoint() 36 | { 37 | if ($this->hasCustomEndPoint('patch')) { 38 | return $this->getCustomEndPoint('patch').$this->getKeyForEndPoint(); 39 | } 40 | 41 | return $this->endPoint.'?occurrence_id='.$this->getKey(); 42 | } 43 | 44 | public function getDeleteEndPoint() 45 | { 46 | if ($this->hasCustomEndPoint('delete')) { 47 | return $this->getCustomEndPoint('delete').$this->getKeyForEndPoint(); 48 | } 49 | 50 | return $this->endPoint.'?occurrence_id='.$this->getKey(); 51 | } 52 | 53 | public function delete($scheduleForReminder = true) 54 | { 55 | return $this->newQuery()->addQuery('schedule_for_reminder', $scheduleForReminder)->delete(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/WebinarParticipant.php: -------------------------------------------------------------------------------- 1 | apiMultipleDataField; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/WebinarRegistrant.php: -------------------------------------------------------------------------------- 1 | apiMultipleDataField; 20 | } 21 | 22 | public function customQuestions() 23 | { 24 | return $this->hasMany(CustomQuestion::class); 25 | } 26 | 27 | 28 | public function beforeQuery($query) 29 | { 30 | if (isset($this->occurrence_id)) { 31 | $query->addQuery('occurrence_id', $this->occurrence_id); 32 | } 33 | } 34 | 35 | public function beforeInsert($query) 36 | { 37 | if (isset($this->occurrence_id)) { 38 | $query->addQuery('occurrence_id', $this->occurrence_id); 39 | } 40 | } 41 | 42 | protected function updateAction($action) 43 | { 44 | if ($this->exists()) { 45 | if (isset($this->occurrence_id)) { 46 | return $this->newQuery()->sendRequest('put', ['webinars/'.$this->webinar_id.'/registrants/status', ['action' => $action, 'registrants' => [['id' => $this->id, 'email' => $this->email]]], ['occurrence_id' => $this->occurrence_id]])->successful(); 47 | } else { 48 | return $this->newQuery()->sendRequest('put', ['webinars/'.$this->webinar_id.'/registrants/status', ['action' => $action, 'registrants' => [['id' => $this->id, 'email' => $this->email]]]])->successful(); 49 | } 50 | } 51 | } 52 | 53 | public function approve() 54 | { 55 | return $this->updateAction('approve'); 56 | } 57 | 58 | public function deny() 59 | { 60 | return $this->updateAction('deny'); 61 | } 62 | 63 | public function cancel() 64 | { 65 | return $this->updateAction('cancel'); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/WebinarSetting.php: -------------------------------------------------------------------------------- 1 | hasMany(GlobalDialInCountry::class); 12 | } 13 | 14 | public function attendeesAndPanelistsReminderEmailNotification() 15 | { 16 | return $this->hasOne(EmailNotification::class); 17 | } 18 | 19 | public function followUpAbsenteesEmailNotification() 20 | { 21 | return $this->hasOne(EmailNotification::class); 22 | } 23 | 24 | public function followUpAttendeesEmailNotification() 25 | { 26 | return $this->hasOne(EmailNotification::class); 27 | } 28 | 29 | public function questionAndAnswer() 30 | { 31 | return $this->hasOne(QuestionAnswer::class); 32 | } 33 | } 34 | --------------------------------------------------------------------------------