From b7386b93cee8e5834f4c243eb74929133ae884ca Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Wed, 8 Jul 2020 21:20:27 +0100 Subject: [PATCH 01/13] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..1d13292 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + + + + +- API Version: #.#.# +- Laravel Version: #.#.# +- PHP Version: #.#.# + +**Describe the bug** +A clear and concise description of what the bug is. + + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem here. From 57b3ccb138c568ac3f79dd971825ae461ebf8675 Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Thu, 16 Jul 2020 22:31:48 +0100 Subject: [PATCH 02/13] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b20e01f..0076e29 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ At present we cover the following modules - Past Meetings - Webinars - Past Webinars +- Recordings (get only) 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. @@ -505,6 +506,7 @@ This is the main access for most models in Zoom. $user->schedulers // hasMany relationship $user->permission // hasOne relationship $user->token // hasOne relationship + $user->recordings // hasMany relationship // Special functions @@ -631,6 +633,7 @@ This is the main access for most models in Zoom. $meeting->liveStream // hasOne relationship $meeting->registrationQuestions // hasMany relationship $meeting->trackingFields // hasMany relationship + $meeting->recordings // hasOne relationship // Once we have the meeting we can update registrants From 155e4f7428afa433bfdf9d167afb6397a1adb14d Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Thu, 23 Jul 2020 12:55:27 +0100 Subject: [PATCH 03/13] Update README.md --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0076e29..7c77ca9 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,13 @@ Laravel Zoom API Package 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. -## Updates +## Updates & Issues -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. - -You can follow us on Twitter where we will post any major updates. [MacsiDigital Twitter](https://twitter.com/MacsiDigital) - -## Updates +We only accept Issues through [Github](https://github.com/MacsiDigital/laravel-zoom) 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. -You can follow us on twitter where we will post any major updates. [MacsiDigital](https://twitter.com/MacsiDigital) +You can follow us on Twitter where we will post any major updates. [MacsiDigital Twitter](https://twitter.com/MacsiDigital) ## Installation @@ -35,7 +31,7 @@ For versioning:- - 1.0 - deprecated - was a quick build for a client project, not recommended you use this version. -- 2.0 - Laravel 5.5 - 5.8 - bug fixes only, if there are any issues then create a pull request. There only as 5.5 is a LTS version of Laravel. To keep it 5.5 we use casts from Laravel 5.5, 5.8 had some updates but they wont be available. +- 2.0 - Laravel 5.5 - 5.8 - bug fixes only, if there are any issues then create a pull request. There only as 5.5 is a LTS version of Laravel. To keep it 5.5 we use casts from Laravel 5.5, 5.8 had some updates but they wont be available. **Laravel 5.5 support is until August 30th, 2020, at which point we will drop support for this version** - 3.0 - Laravel 6.0 - Maintained, feel free to create pull requests. This is open source which is a 2 way street. From 2319b53904162adfff2f68fa30b776497fcd1cac Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Mon, 27 Jul 2020 18:32:51 +0100 Subject: [PATCH 04/13] Create FUNDING.yml --- .github/FUNDING.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..5eb972e --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: [MacsiDigital] From 0acaea459339931baffbf3ce6536acd41bf1a094 Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Fri, 14 Aug 2020 19:16:06 +0100 Subject: [PATCH 05/13] Fix typo in meeting settings --- src/Requests/StoreMeetingSetting.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Requests/StoreMeetingSetting.php b/src/Requests/StoreMeetingSetting.php index de1c6a1..0dcd22a 100644 --- a/src/Requests/StoreMeetingSetting.php +++ b/src/Requests/StoreMeetingSetting.php @@ -19,7 +19,7 @@ class StoreMeetingSetting extends PersistResource "approval_type" => "nullable|in:0,1,2", "registration_type" => "nullable|in:1,2,3", "audio" => "nullable|in:both,telephony,voip", - "local_recording" => "nullable|in:local,cloud,none", + "auto_recording" => "nullable|in:local,cloud,none", "enforce_login" => "nullable|boolean", "enforce_login_domains" => "nullable|string", "alternative_hosts" => "nullable|string", @@ -39,5 +39,5 @@ class StoreMeetingSetting extends PersistResource "global_dial_in_countries" => StoreGlobalDialInCountry::class, "global_dial_in_numbers" => StoreGlobalDialInNumber::class ]; - + } From b1cd7c54a7fed3d340be11820910496fa0be8644 Mon Sep 17 00:00:00 2001 From: Christopher Lass Date: Tue, 1 Sep 2020 19:29:38 +0200 Subject: [PATCH 06/13] Fix updatePassword and import missing ValidationException --- src/User.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/User.php b/src/User.php index 791fbd8..b073cb1 100644 --- a/src/User.php +++ b/src/User.php @@ -4,6 +4,7 @@ use MacsiDigital\Zoom\Support\Model; use MacsiDigital\Zoom\Exceptions\FileTooLargeException; +use MacsiDigital\Zoom\Exceptions\ValidationException; class User extends Model { @@ -117,10 +118,10 @@ public function updateStatus($status) public function updatePassword($password) { - if(count($password) < 8){ + if(strlen($password) >= 8){ return $this->newQuery()->sendRequest('put', ['users/'.$this->id.'/password', ['password' => $password]])->successful(); } else { - throw new ValidationException('Password must be 8 characters'); + throw new ValidationException('Password must be at least 8 characters'); } } From 46eeabd7d35d2ca9450bdea467bd175db65c8473 Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Mon, 7 Sep 2020 15:41:26 +0100 Subject: [PATCH 07/13] Bug fix Update Recurrence to be string and not integer --- src/Requests/StoreRecurrence.php | 2 +- src/Requests/UpdateRecurrence.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Requests/StoreRecurrence.php b/src/Requests/StoreRecurrence.php index c7f495b..04c4c4b 100644 --- a/src/Requests/StoreRecurrence.php +++ b/src/Requests/StoreRecurrence.php @@ -10,7 +10,7 @@ class StoreRecurrence extends PersistResource protected $persistAttributes = [ "type" => "nullable|integer|in:1,2,3", "repeat_interval" => "nullable|integer", - "weekly_days" => "nullable|integer|in:1,2,3,4,5,6,7", + "weekly_days" => "nullable|string", "monthly_day" => "nullable|numeric|between:1,31", "monthly_week" => "nullable|numeric|in:-1,1,2,3,4", "monthly_week_day" => "nullable|integer|in:1,2,3,4,5,6,7", diff --git a/src/Requests/UpdateRecurrence.php b/src/Requests/UpdateRecurrence.php index 808a9ec..304f227 100644 --- a/src/Requests/UpdateRecurrence.php +++ b/src/Requests/UpdateRecurrence.php @@ -10,7 +10,7 @@ class UpdateRecurrence extends PersistResource protected $persistAttributes = [ "type" => "nullable|integer|in:1,2,3", "repeat_interval" => "nullable|integer", - "weekly_days" => "nullable|integer|in:1,2,3,4,5,6,7", + "weekly_days" => "nullable|string", "monthly_day" => "nullable|numeric|between:1,31", "monthly_week" => "nullable|numeric|in:-1,1,2,3,4", "monthly_week_day" => "nullable|integer|in:1,2,3,4,5,6,7", From ff0862087e18cde02aa8b66dee5b64226802ccd5 Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Mon, 7 Sep 2020 16:03:38 +0100 Subject: [PATCH 08/13] Add find to WebinarRegistrants --- src/WebinarRegistrant.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebinarRegistrant.php b/src/WebinarRegistrant.php index b5887da..5d50a39 100644 --- a/src/WebinarRegistrant.php +++ b/src/WebinarRegistrant.php @@ -10,7 +10,7 @@ class WebinarRegistrant extends Model protected $endPoint = 'webinars/{webinar:id}/registrants'; - protected $allowedMethods = ['get', 'post', 'put']; + protected $allowedMethods = ['find', 'get', 'post', 'put']; protected $apiMultipleDataField = 'registrants'; From 47d44e35fbabbd45ef6ceb84e18d4471930ea8ea Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Tue, 8 Sep 2020 16:04:49 +0100 Subject: [PATCH 09/13] Update! Update docs to be more brand consistant Laravel 8.0 --- .github/workflows/php-cs-fixer.yml | 29 ++++++++++ .github/workflows/psalm.yml | 33 +++++++++++ .github/workflows/run-tests.yml | 47 ++++++++++++++++ .gitignore | 5 +- .php_cs | 38 +++++++++++++ .scrutinizer.yml | 19 ------- .styleci.yml | 4 -- .travis.yml | 21 ------- CHANGELOG.md | 4 ++ CONTRIBUTING.md | 14 ++--- LICENSE.md | 23 ++------ README.md | 89 +++++++++++++++++------------- composer.json | 17 ++++-- psalm.xml | 25 +++++++++ 14 files changed, 251 insertions(+), 117 deletions(-) create mode 100644 .github/workflows/php-cs-fixer.yml create mode 100644 .github/workflows/psalm.yml create mode 100644 .github/workflows/run-tests.yml create mode 100644 .php_cs delete mode 100644 .scrutinizer.yml delete mode 100644 .styleci.yml delete mode 100644 .travis.yml create mode 100644 psalm.xml diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml new file mode 100644 index 0000000..2cf4428 --- /dev/null +++ b/.github/workflows/php-cs-fixer.yml @@ -0,0 +1,29 @@ +name: Check & fix styling + +on: [push] + +jobs: + style: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v1 + + - name: Fix style + uses: docker://oskarstark/php-cs-fixer-ga + with: + args: --config=.php_cs --allow-risky=yes + + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v2.3.0 + with: + commit_message: Fix styling + branch: ${{ steps.extract_branch.outputs.branch }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml new file mode 100644 index 0000000..41244a5 --- /dev/null +++ b/.github/workflows/psalm.yml @@ -0,0 +1,33 @@ +name: Psalm + +on: + push: + paths: + - '**.php' + - 'psalm.xml' + +jobs: + psalm: + name: psalm + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.3' + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + + - name: Cache composer dependencies + uses: actions/cache@v1 + with: + path: vendor + key: composer-${{ hashFiles('composer.lock') }} + + - name: Run composer install + run: composer install -n --prefer-dist + + - name: Run psalm + run: ./vendor/bin/psalm -c psalm.xml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..348385e --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,47 @@ +name: run-tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest, windows-latest] + php: [7.3, 7.4] + laravel: [6.*, 7.*, 8.*] + dependency-version: [prefer-lowest, prefer-stable] + include: + - laravel: 8.* + testbench: 6.* + - laravel: 7.* + testbench: 5.* + - laravel: 6.* + testbench: 4.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v1 + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v1 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + - name: Execute tests + run: vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index b3c9001..7918384 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,8 @@ composer.lock docs vendor coverage -.DS_Store +node_modules +.phpunit.result.cache +.idea /.idea +.php_cs.cache diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..6b6c913 --- /dev/null +++ b/.php_cs @@ -0,0 +1,38 @@ +notPath('bootstrap/*') + ->notPath('storage/*') + ->notPath('storage/*') + ->notPath('resources/view/mail/*') + ->in([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]) + ->name('*.php') + ->notName('*.blade.php') + ->ignoreDotFiles(true) + ->ignoreVCS(true); + +return PhpCsFixer\Config::create() + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'ordered_imports' => ['sortAlgorithm' => 'alpha'], + 'no_unused_imports' => true, + 'not_operator_with_successor_space' => true, + 'trailing_comma_in_multiline_array' => true, + 'phpdoc_scalar' => true, + 'unary_operator_spaces' => true, + 'binary_operator_spaces' => true, + 'blank_line_before_statement' => [ + 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], + ], + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_var_without_name' => true, + 'method_argument_space' => [ + 'on_multiline' => 'ensure_fully_multiline', + 'keep_multiple_spaces_after_comma' => true, + ] + ]) + ->setFinder($finder); diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index df16b68..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,19 +0,0 @@ -filter: - excluded_paths: [tests/*] - -checks: - php: - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true - diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index f4d3cbc..0000000 --- a/.styleci.yml +++ /dev/null @@ -1,4 +0,0 @@ -preset: laravel - -disabled: - - single_class_element_per_statement diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 24c2d6c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: php - -php: - - 7.1 - - 7.2 - - 7.3 - -env: - matrix: - - COMPOSER_FLAGS="--prefer-lowest" - - COMPOSER_FLAGS="" - -before_script: - - travis_retry composer self-update - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source - -script: - - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover - -after_script: - - php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover diff --git a/CHANGELOG.md b/CHANGELOG.md index 60f877d..17c1307 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `laravel-zoom` will be documented in this file +## 4.1.0 - 2020-09-08 + +Laravel 8.0 + ## 4.0.8 - 2020-07-16 Add Recordings diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b4ae1c4..b6c4c5b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,21 +6,15 @@ Please read and understand the contribution guide before creating an issue or pu ## Etiquette -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. +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. -Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the -world that developers are civilized and selfless people. +Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the world that developers are civilized and selfless people. -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 skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. +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. ## Viability -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. +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. ## Procedure diff --git a/LICENSE.md b/LICENSE.md index e51392a..62095fd 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,21 +1,10 @@ -MIT License +The MIT License (MIT) -Copyright (c) Macsi Digital Ltd // Colin Hall +Copyright (c) Macsi Digital Ltd -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: +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: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +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. -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 NONINFRINGEMENT. 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. \ No newline at end of file diff --git a/README.md b/README.md index 7c77ca9..ee74215 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,21 @@ -# Laravel package for Zoom API +# Laravel Zoom -[![Latest Version on Packagist](https://img.shields.io/packagist/v/macsidigital/laravel-zoom.svg?style=flat-square)](https://packagist.org/packages/macsidigital/laravel-zoom) -[![Build Status](https://img.shields.io/travis/macsidigital/laravel-zoom/master.svg?style=flat-square)](https://travis-ci.org/MacsiDigital/laravel-zoom) -[![StyleCI](https://github.styleci.io/repos/193588988/shield?branch=master)](https://github.styleci.io/repos/193588988) -[![Total Downloads](https://img.shields.io/packagist/dt/macsidigital/laravel-zoom.svg?style=flat-square)](https://packagist.org/packages/macsidigital/laravel-zoom) +## Laravel Zoom API Client + +![Header Image](https://github.com/MacsiDigital/repo-design/raw/master/laravel-zoom/header.png) + +

+ tests badge + version badge + downloads badge +

Laravel Zoom API Package +## Support us + +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. + ## Our API mission! 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. @@ -31,11 +40,11 @@ For versioning:- - 1.0 - deprecated - was a quick build for a client project, not recommended you use this version. -- 2.0 - Laravel 5.5 - 5.8 - bug fixes only, if there are any issues then create a pull request. There only as 5.5 is a LTS version of Laravel. To keep it 5.5 we use casts from Laravel 5.5, 5.8 had some updates but they wont be available. **Laravel 5.5 support is until August 30th, 2020, at which point we will drop support for this version** +- 2.0 - Laravel 5.5 - 5.8 - deprecated, no longer maintained - 3.0 - Laravel 6.0 - Maintained, feel free to create pull requests. This is open source which is a 2 way street. -- 4.0 - Laravel 7.0 - Maintained, feel free to create pull requests. This is open source which is a 2 way street. +- 4.0 - Laravel 7.0 - 8.0 - Maintained, feel free to create pull requests. This is open source which is a 2 way street. ### Configuration file @@ -105,7 +114,7 @@ There are 2 main ways to work with models, to call them directly from the access $user = new \MacsiDigital\Zoom\User($zoom); ``` -## Working with models +### Working with models 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. @@ -133,9 +142,9 @@ Each model may also have some custom functions where Zoom has some unique functi $user->updateProfilePicture($image); // Path to image ``` -## Common get functions +### Common get functions -### First +#### First We utilise the first function to return the first record from the record set. This will return an instantiated model. @@ -143,7 +152,7 @@ We utilise the first function to return the first record from the record set. T $user = Zoom::user()->where('status', 'active')->first(); ``` -### Find +#### Find We utilise the find function to return a record by searching for it by a unique attribute. This will return an instantiated model. @@ -157,7 +166,7 @@ We utilise the find function to return a record by searching for it by a unique // for most models this is only the id. The past models utilise the uuid instead of the id. ``` -### All +#### All The find all function returns a customised Laravel Collection, which we call a resultset. @@ -169,7 +178,7 @@ When calling the all function we will make up to 5 API calls to retrieve all the More info below in ResultSets. -### Get +#### Get 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. @@ -193,7 +202,7 @@ You can disable the pagination, so it behaves the same as the all() function $users = Zoom::user()->where('status', 'active')->setPaginate(false)->setPerPage(300)->get(); // will return 300 records * 5 request (or amount set in config) = 1500 records ``` -### resultSet +#### resultSet 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. @@ -313,11 +322,11 @@ There are also a number of helper functions. 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. -## Persisting Models +### Persisting Models Again, the aim is to be similar to laravel, so you can utilise the save, create, update and make methods. -### Save +#### Save 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. @@ -329,7 +338,7 @@ To save a model we will use the save method, this will determine if the model is $user->save(); ``` -### Create +#### Create 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. @@ -351,7 +360,7 @@ To create a user. ]); ``` -### Make +#### Make 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. @@ -361,7 +370,7 @@ Make is similar to create except it will not persist the model to the API. This Zoom::user()->find('id')->meetings()->save($meeting); ``` -### Update +#### Update We can also mass update attributes. @@ -369,7 +378,7 @@ We can also mass update attributes. $user = Zoom::user()->find('id')->update(['field' => 'value', 'another_field' => 'value']); ``` -## Relationships +### Relationships 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. @@ -395,7 +404,7 @@ The later is handy when we need to filter results As noted above, Zoom has very limited queryable filters, so check with the Zoom documentation. -### Save & Create +#### Save & Create We can utilise the create and save functions on the relationship model to create models that require a relationship. @@ -433,17 +442,17 @@ We can also utilise the Make and Attach methods for creating and attaching model // The later is very uncommon in Zoom and unlikely to be used due to the setup of relationships, but is an option. ``` -## Validation +### Validation 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. 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. -## Resources +### Resources -We give a brief overview of the common models, we have not included any validation requirements, you will need to check documentaiton for this. +We give a brief overview of the common models, we have not included any validation requirements, you will need to check documentation for this. -### Roles +#### Roles ``` php //To get a new instance @@ -473,7 +482,7 @@ We give a brief overview of the common models, we have not included any validati $role->delete(); // Delete (destroy) role. ``` -### Users +#### Users This is the main access for most models in Zoom. @@ -522,7 +531,7 @@ This is the main access for most models in Zoom. $user->delete(); // Delete (destroy) user. ``` -#### User Settings +##### User Settings ``` php //To get a new instance @@ -557,7 +566,7 @@ This is the main access for most models in Zoom. // $user()->settings()->where('option', 'meeting_authentication')->get(); // Allowed values meeting_authentication, recording_authentication. ``` -### Meetings +#### Meetings ``` php //To get a new instance @@ -660,7 +669,7 @@ This is the main access for most models in Zoom. $meeting->delete($scheduleForReminder); // Delete (destroy) meeting. ScheduleForReminder true by default ``` -### Webinars +#### Webinars ``` php //To get a new instance @@ -756,7 +765,7 @@ This is the main access for most models in Zoom. $webinar->delete(); // Delete (destroy) webinar. ``` -### Meeting/Webinar Occurences +#### Meeting/Webinar Occurrences We are showing info for meeting, you will need to switch out meeting to webinar for webinars. @@ -791,7 +800,7 @@ We are showing info for meeting, you will need to switch out meeting to webinar $occurrence->delete(); ``` -### Meeting/Webinar Settings +#### Meeting/Webinar Settings We are showing info for meeting, you will need to switch out meeting to webinar for webinars. @@ -816,37 +825,39 @@ We are showing info for meeting, you will need to switch out meeting to webinar $setting->globalDialInCountries // HasMany relationship ``` -### Past Meetings +#### Past Meetings Coming soon -### Past Webinars +#### Past Webinars Coming soon ## To Do's +- Documentation Site - Documentation for other Meeting/Webinar relationships - Documentation for Past Meetings & Past Webinars - OAuth2 implementation +- Tests -### Changelog +## Changelog -Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. +Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. ## Contributing Please see [CONTRIBUTING](CONTRIBUTING.md) for details. -### Security +## Security -If you discover any security related issues, please email colin@macsi.co.uk instead of using the issue tracker. +If you discover any security-related issues, please email [info@macsi.co.uk](mailto:info@masi.co.uk) instead of using the issue tracker. ## Credits -- [MacsiDigital](https://github.com/macsidigital) -- [Colin Hall](https://github.com/colinhall17) +- [Colin Hall](https://github.com/ColinHall) +- [MacsiDigital](https://github.com/MacsiDigital) - [All Contributors](../../contributors) ## License diff --git a/composer.json b/composer.json index 0087522..48b4793 100644 --- a/composer.json +++ b/composer.json @@ -13,13 +13,16 @@ } ], "require": { - "php": "^7.2.5", - "illuminate/support": "^7.0", + "php": "^7.3", + "illuminate/support": "^7.0|^8,0", "macsidigital/laravel-api-client": "^3.0" }, "require-dev": { - "orchestra/testbench": "^5.0", - "phpunit/phpunit": "^8.5" + "friendsofphp/php-cs-fixer": "^2.16", + "orchestra/testbench": "^4.0|^5.0|^6.0", + "phpunit/phpunit": "^8.0|^9.0", + "psalm/plugin-laravel": "^1.2", + "vimeo/psalm": "^3.11" }, "autoload": { "psr-4": { @@ -32,9 +35,10 @@ } }, "scripts": { + "psalm": "vendor/bin/psalm", "test": "vendor/bin/phpunit", - "test-coverage": "vendor/bin/phpunit --coverage-html coverage" - + "test-coverage": "vendor/bin/phpunit --coverage-html coverage", + "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes" }, "config": { "sort-packages": true @@ -50,6 +54,7 @@ } }, "minimum-stability" : "dev", + "prefer-stable": true, "repositories": [ { "type": "path", diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000..1e63ae8 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + From 5be1f141dfbb372a3e6d5a94fe7ce816a067a951 Mon Sep 17 00:00:00 2001 From: colinhall17 Date: Tue, 8 Sep 2020 15:05:33 +0000 Subject: [PATCH 10/13] Fix styling --- src/Absentees.php | 6 +- src/Account.php | 5 +- src/Assistant.php | 3 +- src/Contracts/Zoom.php | 1 - src/CustomQuestion.php | 1 - src/EmailNotification.php | 1 - src/Exceptions/FileTooLargeException.php | 12 +- src/Exceptions/ValidationException.php | 12 +- src/Feature.php | 1 - src/File.php | 2 +- src/GlobalDialInCountry.php | 1 - src/GlobalDialInNumber.php | 1 - src/InMeeting.php | 1 - src/Instance.php | 2 +- src/Integration.php | 1 - src/Invitation.php | 5 +- src/LiveStream.php | 5 +- src/LiveStreamStatus.php | 9 +- src/LiveStreamStatusSetting.php | 3 +- src/Meeting.php | 17 ++- src/MeetingOccurrence.php | 22 ++-- src/MeetingPasswordRequirement.php | 1 - src/MeetingRecording.php | 2 +- src/MeetingRegistrant.php | 12 +- src/MeetingSetting.php | 9 +- src/Panelist.php | 5 +- src/Participant.php | 5 +- src/PastMeeting.php | 48 ++++---- src/PastWebinar.php | 58 +++++----- src/Permission.php | 6 +- src/Poll.php | 13 +-- src/PollQuestion.php | 1 - src/PollResult.php | 4 +- src/Privilege.php | 1 - src/QA.php | 4 +- src/Question.php | 1 - src/Recording.php | 2 +- src/RecordingPasswordRequirement.php | 1 - src/RegistrantCustomQuestion.php | 1 - src/RegistrationQuestion.php | 1 - src/Requests/StoreAccount.php | 4 +- src/Requests/StoreAssistant.php | 6 +- src/Requests/StoreCustomQuestion.php | 2 - src/Requests/StoreGlobalDialInCountry.php | 12 +- src/Requests/StoreGlobalDialInNumber.php | 12 +- src/Requests/StoreMeeting.php | 26 ++--- src/Requests/StoreMeetingSetting.php | 56 +++++---- src/Requests/StorePanelist.php | 4 +- src/Requests/StorePoll.php | 8 +- src/Requests/StorePollQuestion.php | 10 +- src/Requests/StoreRecurrence.php | 18 ++- src/Requests/StoreRegistrant.php | 16 ++- .../StoreRegistrantCustomQuestion.php | 7 +- src/Requests/StoreRole.php | 8 +- src/Requests/StoreTrackingField.php | 6 +- src/Requests/StoreUser.php | 24 ++-- src/Requests/StoreWebinar.php | 22 ++-- src/Requests/StoreWebinarSetting.php | 52 +++++---- src/Requests/UpdateAccount.php | 4 +- src/Requests/UpdateAssistant.php | 6 +- src/Requests/UpdateCustomQuestion.php | 11 +- src/Requests/UpdateEmailNotification.php | 10 +- src/Requests/UpdateFeature.php | 14 +-- src/Requests/UpdateGlobalDialInCountry.php | 12 +- src/Requests/UpdateGlobalDialInNumber.php | 12 +- src/Requests/UpdateInMeeting.php | 63 +++++------ src/Requests/UpdateIntegration.php | 3 +- src/Requests/UpdateLiveStream.php | 11 +- src/Requests/UpdateLiveStreamStatus.php | 11 +- .../UpdateLiveStreamStatusSetting.php | 9 +- src/Requests/UpdateMeeting.php | 24 ++-- .../UpdateMeetingPasswordRequirement.php | 13 +-- src/Requests/UpdateMeetingSetting.php | 56 +++++---- src/Requests/UpdateOccurrence.php | 8 +- src/Requests/UpdatePoll.php | 8 +- src/Requests/UpdatePollQuestion.php | 10 +- src/Requests/UpdateQuestion.php | 7 +- src/Requests/UpdateRecording.php | 29 +++-- .../UpdateRecordingPasswordRequirement.php | 13 +-- src/Requests/UpdateRecurrence.php | 18 ++- src/Requests/UpdateRegistrationQuestion.php | 8 +- src/Requests/UpdateRole.php | 8 +- src/Requests/UpdateScheduleMeeting.php | 42 ++++--- src/Requests/UpdateSetting.php | 5 +- src/Requests/UpdateTelephony.php | 9 +- src/Requests/UpdateTrackingField.php | 6 +- src/Requests/UpdateTsp.php | 9 +- src/Requests/UpdateUser.php | 34 +++--- src/Requests/UpdateWebinar.php | 21 ++-- src/Requests/UpdateWebinarSetting.php | 52 +++++---- src/Role.php | 9 +- src/ScheduleMeeting.php | 2 +- src/Scheduler.php | 3 +- src/Setting.php | 19 ++-- src/Support/Client.php | 3 +- src/Support/Entry.php | 17 ++- src/Support/Model.php | 8 +- src/Telephony.php | 1 - src/Token.php | 6 +- src/TrackingField.php | 1 - src/TrackingSource.php | 4 +- src/Tsp.php | 1 - src/User.php | 18 +-- src/Webinar.php | 5 +- src/WebinarOccurrence.php | 10 +- src/WebinarRegistrant.php | 12 +- src/WebinarSetting.php | 6 +- tests/Resources/EndPoint.php | 106 +++++++++--------- tests/Unit/TestCase.php | 10 +- tests/Unit/UserTest.php | 14 +-- 110 files changed, 626 insertions(+), 754 deletions(-) diff --git a/src/Absentees.php b/src/Absentees.php index 6287715..1d8af45 100644 --- a/src/Absentees.php +++ b/src/Absentees.php @@ -6,11 +6,9 @@ class Absentees extends Model { + protected $endPoint = '/past_webinars/{webinar:uuid}/absentees'; - protected $endPoint = '/past_webinars/{webinar:uuid}/absentees'; - - protected $allowedMethods = ['get']; + protected $allowedMethods = ['get']; protected $apiMultipleDataField = 'absentees'; - } diff --git a/src/Account.php b/src/Account.php index 32d2191..658cdeb 100644 --- a/src/Account.php +++ b/src/Account.php @@ -6,8 +6,8 @@ class Account extends Model { - // API included but its not open to the majority of API Users - protected $insertResource = 'MacsiDigital\Zoom\Requests\StoreAccount'; + // API included but its not open to the majority of API Users + protected $insertResource = 'MacsiDigital\Zoom\Requests\StoreAccount'; protected $updateResource = 'MacsiDigital\Zoom\Requests\UpdateAccount'; protected $endPoint = 'accounts'; @@ -17,5 +17,4 @@ class Account extends Model protected $apiDataField = ''; protected $apiMultipleDataField = 'accounts'; - } diff --git a/src/Assistant.php b/src/Assistant.php index a966873..ef31aed 100644 --- a/src/Assistant.php +++ b/src/Assistant.php @@ -15,7 +15,7 @@ class Assistant extends Model protected $apiMultipleDataField = 'assistants'; - public function user() + public function user() { return $this->belongsTo(User::class); } @@ -24,5 +24,4 @@ public function getApiMultipleDataField() { return $this->apiMultipleDataField; } - } diff --git a/src/Contracts/Zoom.php b/src/Contracts/Zoom.php index 633bec8..83fff6d 100644 --- a/src/Contracts/Zoom.php +++ b/src/Contracts/Zoom.php @@ -6,5 +6,4 @@ interface Zoom extends ClientFacade { - } diff --git a/src/CustomQuestion.php b/src/CustomQuestion.php index 1549b1e..0caa703 100644 --- a/src/CustomQuestion.php +++ b/src/CustomQuestion.php @@ -6,5 +6,4 @@ class CustomQuestion extends Resource { - } diff --git a/src/EmailNotification.php b/src/EmailNotification.php index 7141195..d7b9b5b 100644 --- a/src/EmailNotification.php +++ b/src/EmailNotification.php @@ -6,5 +6,4 @@ class EmailNotification extends Resource { - } diff --git a/src/Exceptions/FileTooLargeException.php b/src/Exceptions/FileTooLargeException.php index 964fa9a..f2bf9ce 100644 --- a/src/Exceptions/FileTooLargeException.php +++ b/src/Exceptions/FileTooLargeException.php @@ -6,10 +6,8 @@ class FileTooLargeException extends Exception { - - public function __construct($file, $size, $allowedSize) - { - parent::__construct($file.' is '.$size.'MB and is larger than the maximum allowed size for uploads of '.$allowedSize); - } - -} \ No newline at end of file + public function __construct($file, $size, $allowedSize) + { + parent::__construct($file.' is '.$size.'MB and is larger than the maximum allowed size for uploads of '.$allowedSize); + } +} diff --git a/src/Exceptions/ValidationException.php b/src/Exceptions/ValidationException.php index 9b31c19..9b6de43 100644 --- a/src/Exceptions/ValidationException.php +++ b/src/Exceptions/ValidationException.php @@ -6,10 +6,8 @@ class ValidationException extends Exception { - - public function __construct($message) - { - parent::__construct($message); - } - -} \ No newline at end of file + public function __construct($message) + { + parent::__construct($message); + } +} diff --git a/src/Feature.php b/src/Feature.php index 18a1cdc..fb20bec 100644 --- a/src/Feature.php +++ b/src/Feature.php @@ -6,5 +6,4 @@ class Feature extends Resource { - } diff --git a/src/File.php b/src/File.php index 3eb4e15..88d1d57 100644 --- a/src/File.php +++ b/src/File.php @@ -8,7 +8,7 @@ class File extends Model { protected $endPoint = '/past_webinars/{webinar:uuid}/files'; - protected $allowedMethods = ['get']; + protected $allowedMethods = ['get']; protected $apiMultipleDataField = 'in_meeting_files'; } diff --git a/src/GlobalDialInCountry.php b/src/GlobalDialInCountry.php index 58f2d0a..1efa76c 100644 --- a/src/GlobalDialInCountry.php +++ b/src/GlobalDialInCountry.php @@ -6,5 +6,4 @@ class GlobalDialInCountry extends Resource { - } diff --git a/src/GlobalDialInNumber.php b/src/GlobalDialInNumber.php index 47b7292..17a0250 100644 --- a/src/GlobalDialInNumber.php +++ b/src/GlobalDialInNumber.php @@ -6,5 +6,4 @@ class GlobalDialInNumber extends Resource { - } diff --git a/src/InMeeting.php b/src/InMeeting.php index 0530b26..9de9170 100644 --- a/src/InMeeting.php +++ b/src/InMeeting.php @@ -6,5 +6,4 @@ class InMeeting extends Resource { - } diff --git a/src/Instance.php b/src/Instance.php index d83e471..a1b5129 100644 --- a/src/Instance.php +++ b/src/Instance.php @@ -8,7 +8,7 @@ class Instance extends Model { protected $endPoint = '/past_webinars/{webinar:uuid}/instances'; - protected $allowedMethods = ['get']; + protected $allowedMethods = ['get']; protected $apiMultipleDataField = 'instances'; } diff --git a/src/Integration.php b/src/Integration.php index 971bb5e..d6da728 100644 --- a/src/Integration.php +++ b/src/Integration.php @@ -6,5 +6,4 @@ class Integration extends Resource { - } diff --git a/src/Invitation.php b/src/Invitation.php index 271a4f4..4656318 100644 --- a/src/Invitation.php +++ b/src/Invitation.php @@ -6,12 +6,11 @@ class Invitation extends Model { - protected $endPoint = 'meetings/{meeting:id}/invitation'; + protected $endPoint = 'meetings/{meeting:id}/invitation'; protected $allowedMethods = ['get']; protected $apiDataField = ''; protected $apiMultipleDataField = 'invitation'; - -} \ No newline at end of file +} diff --git a/src/LiveStream.php b/src/LiveStream.php index 2e05b6b..4aae279 100644 --- a/src/LiveStream.php +++ b/src/LiveStream.php @@ -6,10 +6,9 @@ class LiveStream extends Model { - protected $endPoint = 'meetings/{meeting:id}/livestream'; + protected $endPoint = 'meetings/{meeting:id}/livestream'; protected $allowedMethods = ['put']; protected $apiMultipleDataField = ''; - -} \ No newline at end of file +} diff --git a/src/LiveStreamStatus.php b/src/LiveStreamStatus.php index 1977f25..f214f65 100644 --- a/src/LiveStreamStatus.php +++ b/src/LiveStreamStatus.php @@ -6,15 +6,14 @@ class LiveStreamStatus extends Model { - protected $endPoint = 'meetings/{meeting:id}/livestream/status'; + protected $endPoint = 'meetings/{meeting:id}/livestream/status'; protected $allowedMethods = ['patch']; protected $apiMultipleDataField = ''; - public function settings() + public function settings() { - return $this->hasOne(LiveStreamStatusSetting::class); + return $this->hasOne(LiveStreamStatusSetting::class); } - -} \ No newline at end of file +} diff --git a/src/LiveStreamStatusSetting.php b/src/LiveStreamStatusSetting.php index 50b101d..238bb39 100644 --- a/src/LiveStreamStatusSetting.php +++ b/src/LiveStreamStatusSetting.php @@ -6,5 +6,4 @@ class LiveStreamStatusSetting extends Resource { - -} \ No newline at end of file +} diff --git a/src/Meeting.php b/src/Meeting.php index d8883e6..6d6e936 100644 --- a/src/Meeting.php +++ b/src/Meeting.php @@ -13,7 +13,7 @@ class Meeting extends Model protected $customEndPoints = [ 'get' => 'users/{user:id}/meetings', - 'post' => 'users/{user:id}/meetings' + 'post' => 'users/{user:id}/meetings', ]; protected $allowedMethods = ['find', 'get', 'post', 'patch', 'delete']; @@ -24,17 +24,17 @@ class Meeting extends Model protected $dates = [ 'start_time', - 'created_at' + 'created_at', ]; public function settings() { - return $this->hasOne(MeetingSetting::class); + return $this->hasOne(MeetingSetting::class); } public function recurrence() { - return $this->hasOne(Recurrence::class); + return $this->hasOne(Recurrence::class); } public function occurrences() @@ -44,12 +44,12 @@ public function occurrences() public function registrants() { - return $this->hasMany(MeetingRegistrant::class); + return $this->hasMany(MeetingRegistrant::class); } public function polls() { - return $this->hasMany(Poll::class); + return $this->hasMany(Poll::class); } public function registrationQuestions() @@ -77,14 +77,13 @@ public function recording() return $this->hasOne(MeetingRecording::class); } - public function delete($scheduleForReminder=true) + public function delete($scheduleForReminder = true) { return $this->newQuery()->addQuery('schedule_for_reminder', $scheduleForReminder)->delete(); } public function endMeeting() { - return $this->newQuery()->sendRequest('put', ['meetings/'.$this->id.'/status', ['action' => 'end']])->successful(); + return $this->newQuery()->sendRequest('put', ['meetings/'.$this->id.'/status', ['action' => 'end']])->successful(); } - } diff --git a/src/MeetingOccurrence.php b/src/MeetingOccurrence.php index 9095ee5..89669e8 100644 --- a/src/MeetingOccurrence.php +++ b/src/MeetingOccurrence.php @@ -20,36 +20,38 @@ class MeetingOccurrence extends Model public function registrants() { - return $this->hasMany(MeetingRegistrant::class, 'meetings', 'meeting_id', ['occurrence_id' => $this->occurrence_id]); + return $this->hasMany(MeetingRegistrant::class, 'meetings', 'meeting_id', ['occurrence_id' => $this->occurrence_id]); } public function getPatchEndPoint() { - if($this->hasCustomEndPoint('patch')){ + if ($this->hasCustomEndPoint('patch')) { return $this->getCustomEndPoint('patch').$this->getKeyForEndPoint(); } + return $this->endPoint.'?occurrence_id='.$this->getKey(); } public function getDeleteEndPoint() { - if($this->hasCustomEndPoint('delete')){ + if ($this->hasCustomEndPoint('delete')) { return $this->getCustomEndPoint('delete').$this->getKeyForEndPoint(); } + return $this->endPoint.'?occurrence_id='.$this->getKey(); } public function find($id) { - $occurence = $this->newQuery()->addQuery('occurrence_id', $id)->getOne(); - $occurence->meeting_id = $this->meeting_id; - $occurence->occurrence_id = $id; - return $occurence; + $occurence = $this->newQuery()->addQuery('occurrence_id', $id)->getOne(); + $occurence->meeting_id = $this->meeting_id; + $occurence->occurrence_id = $id; + + return $occurence; } - public function delete($scheduleForReminder=true) + public function delete($scheduleForReminder = true) { - return $this->newQuery()->addQuery('schedule_for_reminder', $scheduleForReminder)->delete(); + return $this->newQuery()->addQuery('schedule_for_reminder', $scheduleForReminder)->delete(); } - } diff --git a/src/MeetingPasswordRequirement.php b/src/MeetingPasswordRequirement.php index 66d1ee1..77fa8e6 100644 --- a/src/MeetingPasswordRequirement.php +++ b/src/MeetingPasswordRequirement.php @@ -6,5 +6,4 @@ class MeetingPasswordRequirement extends Resource { - } diff --git a/src/MeetingRecording.php b/src/MeetingRecording.php index adee132..15da985 100644 --- a/src/MeetingRecording.php +++ b/src/MeetingRecording.php @@ -7,7 +7,7 @@ class MeetingRecording extends Model { protected $customEndPoints = [ - 'get' => 'meetings/{meeting:id}/recordings' + 'get' => 'meetings/{meeting:id}/recordings', ]; protected $allowedMethods = ['get']; diff --git a/src/MeetingRegistrant.php b/src/MeetingRegistrant.php index 674af51..e5663f7 100644 --- a/src/MeetingRegistrant.php +++ b/src/MeetingRegistrant.php @@ -26,21 +26,22 @@ public function customQuestions() public function beforeQuery($query) { - if(isset($this->occurrence_id)){ + if (isset($this->occurrence_id)) { $query->addQuery('occurrence_id', $this->occurrence_id); } } public function beforeInsert($query) { - if(isset($this->occurrence_id)){ + if (isset($this->occurrence_id)) { $query->addQuery('occurrence_id', $this->occurrence_id); } } - protected function updateAction($action){ - if($this->exists()){ - if(isset($this->occurrence_id)){ + protected function updateAction($action) + { + if ($this->exists()) { + if (isset($this->occurrence_id)) { 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(); } else { return $this->newQuery()->sendRequest('put', ['meetings/'.$this->meeting_id.'/registrants/status', ['action' => $action, 'registrants' => [['id' => $this->id, 'email' => $this->email]]]])->successful(); @@ -62,5 +63,4 @@ public function cancel() { return $this->updateAction('cancel'); } - } diff --git a/src/MeetingSetting.php b/src/MeetingSetting.php index 018a7e7..d6bae5b 100644 --- a/src/MeetingSetting.php +++ b/src/MeetingSetting.php @@ -6,14 +6,13 @@ class MeetingSetting extends Model { - public function globalDialInNumbers() + public function globalDialInNumbers() { - return $this->hasMany(GlobalDialInNumber::class); + return $this->hasMany(GlobalDialInNumber::class); } - public function globalDialInCountries() + public function globalDialInCountries() { - return $this->hasMany(GlobalDialInCountry::class); + return $this->hasMany(GlobalDialInCountry::class); } - } diff --git a/src/Panelist.php b/src/Panelist.php index cbf03a7..0f54467 100644 --- a/src/Panelist.php +++ b/src/Panelist.php @@ -17,8 +17,10 @@ class Panelist extends Model protected $wrapInOnInsert = 'panelists'; protected $wrapInEmptyArrayOnInsert = true; - public function updateAction($action){ + public function updateAction($action) + { $this->action = $action; + return $this; } @@ -36,5 +38,4 @@ public function cancel() { return $this->updateAction('cancel'); } - } diff --git a/src/Participant.php b/src/Participant.php index c7b8d11..433406a 100644 --- a/src/Participant.php +++ b/src/Participant.php @@ -6,10 +6,9 @@ class Participant extends Model { - protected $endPoint = '/past_webinars/{webinar:uuid}/participants'; + protected $endPoint = '/past_webinars/{webinar:uuid}/participants'; - protected $allowedMethods = ['get']; + protected $allowedMethods = ['get']; protected $apiMultipleDataField = 'participants'; - } diff --git a/src/PastMeeting.php b/src/PastMeeting.php index 750ede7..25ded1b 100644 --- a/src/PastMeeting.php +++ b/src/PastMeeting.php @@ -6,33 +6,33 @@ class PastMeeting extends Model { - protected $endPoint = 'past_meetings'; + protected $endPoint = 'past_meetings'; - protected $primaryKey = 'uuid'; + protected $primaryKey = 'uuid'; - protected $allowedMethods = ['find']; + protected $allowedMethods = ['find']; - protected $apiDataField = ''; + protected $apiDataField = ''; protected $apiMultipleDataField = 'meetings'; - public function participants() - { - return $this->hasMany(Participant::class); - } - - public function instances() - { - return $this->hasMany(Instance::class); - } - - public function files() - { - return $this->hasMany(File::class, 'in_meeting_files'); - } - - public function poll() - { - return $this->hasOne(PollResult::class); - } -} \ No newline at end of file + public function participants() + { + return $this->hasMany(Participant::class); + } + + public function instances() + { + return $this->hasMany(Instance::class); + } + + public function files() + { + return $this->hasMany(File::class, 'in_meeting_files'); + } + + public function poll() + { + return $this->hasOne(PollResult::class); + } +} diff --git a/src/PastWebinar.php b/src/PastWebinar.php index e9e139b..70a7eda 100644 --- a/src/PastWebinar.php +++ b/src/PastWebinar.php @@ -6,38 +6,38 @@ class PastWebinar extends Model { - protected $endPoint = 'past_webinars'; + protected $endPoint = 'past_webinars'; - protected $primaryKey = 'uuid'; + protected $primaryKey = 'uuid'; - protected $allowedMethods = ['find']; + protected $allowedMethods = ['find']; - protected $apiDataField = ''; + protected $apiDataField = ''; protected $apiMultipleDataField = 'webinars'; - public function participants() - { - return $this->hasMany(Participant::class); - } - - public function absentees() - { - return $this->hasMany(Absentees::class); - } - - public function instances() - { - return $this->hasMany(Instance::class); - } - - public function files() - { - return $this->hasMany(File::class, 'in_meeting_files'); - } - - public function poll() - { - return $this->hasOne(PollResult::class); - } -} \ No newline at end of file + public function participants() + { + return $this->hasMany(Participant::class); + } + + public function absentees() + { + return $this->hasMany(Absentees::class); + } + + public function instances() + { + return $this->hasMany(Instance::class); + } + + public function files() + { + return $this->hasMany(File::class, 'in_meeting_files'); + } + + public function poll() + { + return $this->hasOne(PollResult::class); + } +} diff --git a/src/Permission.php b/src/Permission.php index 150f70c..8d62d3c 100644 --- a/src/Permission.php +++ b/src/Permission.php @@ -6,14 +6,14 @@ class Permission extends Model { - protected $endPoint = 'users/{user_id}/permissions'; + protected $endPoint = 'users/{user_id}/permissions'; protected $allowedMethods = ['get']; protected $apiMultipleDataField = 'permissions'; - public function user() + public function user() { return $this->belongsTo(User::class); } -} \ No newline at end of file +} diff --git a/src/Poll.php b/src/Poll.php index aba0cd0..91de5ae 100644 --- a/src/Poll.php +++ b/src/Poll.php @@ -6,12 +6,12 @@ class Poll extends Model { - protected $insertResource = 'MacsiDigital\Zoom\Requests\StorePoll'; - protected $storeResource = 'MacsiDigital\Zoom\Requests\UpdatePoll'; + protected $insertResource = 'MacsiDigital\Zoom\Requests\StorePoll'; + protected $storeResource = 'MacsiDigital\Zoom\Requests\UpdatePoll'; - protected $endPoint = '/meetings/{meeting:id}/polls'; + protected $endPoint = '/meetings/{meeting:id}/polls'; - protected $allowedMethods = ['find', 'get', 'post', 'put', 'delete']; + protected $allowedMethods = ['find', 'get', 'post', 'put', 'delete']; protected $apiMultipleDataField = 'polls'; @@ -20,9 +20,8 @@ public function getApiMultipleDataField() return $this->apiMultipleDataField; } - public function questions() + public function questions() { - return $this->hasMany(PollQuestion::class); + return $this->hasMany(PollQuestion::class); } - } diff --git a/src/PollQuestion.php b/src/PollQuestion.php index 3ec3ffe..1815fc3 100644 --- a/src/PollQuestion.php +++ b/src/PollQuestion.php @@ -6,5 +6,4 @@ class PollQuestion extends Resource { - } diff --git a/src/PollResult.php b/src/PollResult.php index 3563e23..11f53f6 100644 --- a/src/PollResult.php +++ b/src/PollResult.php @@ -8,7 +8,7 @@ class PollResult extends Resource { protected $endPoint = '/past_webinars/{webinar:uuid}/polls'; - protected $allowedMethods = ['get']; + protected $allowedMethods = ['get']; protected $apiMultipleDataField = ''; -} \ No newline at end of file +} diff --git a/src/Privilege.php b/src/Privilege.php index ab5d129..bd98fc6 100644 --- a/src/Privilege.php +++ b/src/Privilege.php @@ -6,5 +6,4 @@ class Privilege extends Resource { - } diff --git a/src/QA.php b/src/QA.php index 8eb6308..f54da5d 100644 --- a/src/QA.php +++ b/src/QA.php @@ -8,7 +8,7 @@ class QA extends Resource { protected $endPoint = '/past_meetings/{meeting:uuid}/qa'; - protected $allowedMethods = ['get']; + protected $allowedMethods = ['get']; protected $apiMultipleDataField = ''; -} \ No newline at end of file +} diff --git a/src/Question.php b/src/Question.php index d39b0a0..127aa49 100644 --- a/src/Question.php +++ b/src/Question.php @@ -6,5 +6,4 @@ class Question extends Resource { - } diff --git a/src/Recording.php b/src/Recording.php index 7b63137..560096b 100644 --- a/src/Recording.php +++ b/src/Recording.php @@ -7,7 +7,7 @@ class Recording extends Model { protected $customEndPoints = [ - 'get' => 'users/{user:id}/recordings' + 'get' => 'users/{user:id}/recordings', ]; protected $allowedMethods = ['get']; diff --git a/src/RecordingPasswordRequirement.php b/src/RecordingPasswordRequirement.php index b0ff685..f22f85c 100644 --- a/src/RecordingPasswordRequirement.php +++ b/src/RecordingPasswordRequirement.php @@ -6,5 +6,4 @@ class RecordingPasswordRequirement extends Resource { - } diff --git a/src/RegistrantCustomQuestion.php b/src/RegistrantCustomQuestion.php index 9303e45..b6a9488 100644 --- a/src/RegistrantCustomQuestion.php +++ b/src/RegistrantCustomQuestion.php @@ -6,5 +6,4 @@ class RegistrantCustomQuestion extends Resource { - } diff --git a/src/RegistrationQuestion.php b/src/RegistrationQuestion.php index af9c53b..17b6936 100644 --- a/src/RegistrationQuestion.php +++ b/src/RegistrationQuestion.php @@ -25,5 +25,4 @@ public function customQuestions() { return $this->hasMany(CustomQuestion::class); } - } diff --git a/src/Requests/StoreAccount.php b/src/Requests/StoreAccount.php index b369fb9..583ca74 100644 --- a/src/Requests/StoreAccount.php +++ b/src/Requests/StoreAccount.php @@ -6,9 +6,7 @@ class StoreAccount extends PersistResource { - protected $persistAttributes = [ - + ]; - } diff --git a/src/Requests/StoreAssistant.php b/src/Requests/StoreAssistant.php index d4a4b21..4b2e46d 100644 --- a/src/Requests/StoreAssistant.php +++ b/src/Requests/StoreAssistant.php @@ -6,10 +6,8 @@ class StoreAssistant extends PersistResource { - protected $persistAttributes = [ - 'id' => '', - 'email' => 'nullable|email', + 'id' => '', + 'email' => 'nullable|email', ]; - } diff --git a/src/Requests/StoreCustomQuestion.php b/src/Requests/StoreCustomQuestion.php index d7ab4b5..ff82c79 100644 --- a/src/Requests/StoreCustomQuestion.php +++ b/src/Requests/StoreCustomQuestion.php @@ -6,10 +6,8 @@ class StoreCustomQuestion extends PersistResource { - protected $persistAttributes = [ 'title' => 'required|string', 'value' => 'required|string', ]; - } diff --git a/src/Requests/StoreGlobalDialInCountry.php b/src/Requests/StoreGlobalDialInCountry.php index efdfb0e..a3f4203 100644 --- a/src/Requests/StoreGlobalDialInCountry.php +++ b/src/Requests/StoreGlobalDialInCountry.php @@ -6,13 +6,11 @@ class StoreGlobalDialInCountry extends PersistResource { - protected $persistAttributes = [ - "city" => "nullable|string", - "country" => "nullable|string", - "country_name" => "nullable|string", - "number" => "nullable|string", - "type" => "nullable|in:toll,tollfree" + "city" => "nullable|string", + "country" => "nullable|string", + "country_name" => "nullable|string", + "number" => "nullable|string", + "type" => "nullable|in:toll,tollfree", ]; - } diff --git a/src/Requests/StoreGlobalDialInNumber.php b/src/Requests/StoreGlobalDialInNumber.php index fb0fa8c..d3cc4d0 100644 --- a/src/Requests/StoreGlobalDialInNumber.php +++ b/src/Requests/StoreGlobalDialInNumber.php @@ -6,13 +6,11 @@ class StoreGlobalDialInNumber extends PersistResource { - protected $persistAttributes = [ - "city" => "nullable|string", - "country" => "nullable|string", - "country_name" => "nullable|string", - "number" => "nullable|string", - "type" => "nullable|in:toll,tollfree" + "city" => "nullable|string", + "country" => "nullable|string", + "country_name" => "nullable|string", + "number" => "nullable|string", + "type" => "nullable|in:toll,tollfree", ]; - } diff --git a/src/Requests/StoreMeeting.php b/src/Requests/StoreMeeting.php index 2a61a55..2051f41 100644 --- a/src/Requests/StoreMeeting.php +++ b/src/Requests/StoreMeeting.php @@ -6,22 +6,20 @@ class StoreMeeting extends PersistResource { - protected $persistAttributes = [ - 'topic' => 'nullable|string', - 'type' => 'nullable|integer|in:1,2,3,8', - 'start_time' => 'nullable|date', - 'duration' => 'nullable|integer', - 'timezone' => 'nullable|string', - 'password' => 'nullable|string|max:10', - 'schedule_for' => 'nullable|string', - 'agenda' => 'nullable|string|max:2000' + 'topic' => 'nullable|string', + 'type' => 'nullable|integer|in:1,2,3,8', + 'start_time' => 'nullable|date', + 'duration' => 'nullable|integer', + 'timezone' => 'nullable|string', + 'password' => 'nullable|string|max:10', + 'schedule_for' => 'nullable|string', + 'agenda' => 'nullable|string|max:2000', ]; protected $relatedResource = [ - "settings" => StoreMeetingSetting::class, - "recurrence" => StoreRecurrence::class, - "tracking_fields" => StoreTrackingField::class + "settings" => StoreMeetingSetting::class, + "recurrence" => StoreRecurrence::class, + "tracking_fields" => StoreTrackingField::class, ]; - -} \ No newline at end of file +} diff --git a/src/Requests/StoreMeetingSetting.php b/src/Requests/StoreMeetingSetting.php index 0dcd22a..a062d1b 100644 --- a/src/Requests/StoreMeetingSetting.php +++ b/src/Requests/StoreMeetingSetting.php @@ -6,38 +6,36 @@ class StoreMeetingSetting extends PersistResource { - protected $persistAttributes = [ - "host_video" => "nullable|boolean", - "participant_video" => "nullable|boolean", - "cn_meeting" => "nullable|boolean", - "in_meeting" => "nullable|boolean", - "join_before_host" => "nullable|boolean", - "mute_upon_entry" => "nullable|boolean", - "watermark" => "nullable|boolean", - "use_pmi" => "nullable|boolean", - "approval_type" => "nullable|in:0,1,2", - "registration_type" => "nullable|in:1,2,3", - "audio" => "nullable|in:both,telephony,voip", - "auto_recording" => "nullable|in:local,cloud,none", - "enforce_login" => "nullable|boolean", - "enforce_login_domains" => "nullable|string", - "alternative_hosts" => "nullable|string", - "close_registration" => "nullable|boolean", - "waiting_room" => "nullable|boolean", - "contact_name" => "nullable|string", - "contact_email" => "nullable|string", - "registrants_confirmation_email" => "nullable|boolean", - "registrants_email_notification" => "nullable|boolean", - "meeting_authentication" => "nullable|boolean", - "authentication_option" => "nullable|string", - "authentication_domains" => "nullable|string", - "authentication_name" => "nullable|string", + "host_video" => "nullable|boolean", + "participant_video" => "nullable|boolean", + "cn_meeting" => "nullable|boolean", + "in_meeting" => "nullable|boolean", + "join_before_host" => "nullable|boolean", + "mute_upon_entry" => "nullable|boolean", + "watermark" => "nullable|boolean", + "use_pmi" => "nullable|boolean", + "approval_type" => "nullable|in:0,1,2", + "registration_type" => "nullable|in:1,2,3", + "audio" => "nullable|in:both,telephony,voip", + "auto_recording" => "nullable|in:local,cloud,none", + "enforce_login" => "nullable|boolean", + "enforce_login_domains" => "nullable|string", + "alternative_hosts" => "nullable|string", + "close_registration" => "nullable|boolean", + "waiting_room" => "nullable|boolean", + "contact_name" => "nullable|string", + "contact_email" => "nullable|string", + "registrants_confirmation_email" => "nullable|boolean", + "registrants_email_notification" => "nullable|boolean", + "meeting_authentication" => "nullable|boolean", + "authentication_option" => "nullable|string", + "authentication_domains" => "nullable|string", + "authentication_name" => "nullable|string", ]; protected $relatedResource = [ - "global_dial_in_countries" => StoreGlobalDialInCountry::class, - "global_dial_in_numbers" => StoreGlobalDialInNumber::class + "global_dial_in_countries" => StoreGlobalDialInCountry::class, + "global_dial_in_numbers" => StoreGlobalDialInNumber::class, ]; - } diff --git a/src/Requests/StorePanelist.php b/src/Requests/StorePanelist.php index 107fa93..4905126 100644 --- a/src/Requests/StorePanelist.php +++ b/src/Requests/StorePanelist.php @@ -6,10 +6,8 @@ class StorePanelist extends PersistResource { - protected $persistAttributes = [ "email" => "nullable|email", - "name" => "required|string|max:64" + "name" => "required|string|max:64", ]; - } diff --git a/src/Requests/StorePoll.php b/src/Requests/StorePoll.php index 254f892..4206cbf 100644 --- a/src/Requests/StorePoll.php +++ b/src/Requests/StorePoll.php @@ -6,13 +6,11 @@ class StorePoll extends PersistResource { - protected $persistAttributes = [ - 'title' => 'nullable|string', + 'title' => 'nullable|string', ]; protected $relatedResource = [ - "questions" => StorePollQuestion::class + "questions" => StorePollQuestion::class, ]; - -} \ No newline at end of file +} diff --git a/src/Requests/StorePollQuestion.php b/src/Requests/StorePollQuestion.php index 8660af7..a501f24 100644 --- a/src/Requests/StorePollQuestion.php +++ b/src/Requests/StorePollQuestion.php @@ -6,11 +6,9 @@ class StorePollQuestion extends PersistResource { - protected $persistAttributes = [ - 'name' => 'nullable|string', - 'type' => 'nullable|in:single,multiple', - 'answers' => 'nullable|array' + 'name' => 'nullable|string', + 'type' => 'nullable|in:single,multiple', + 'answers' => 'nullable|array', ]; - -} \ No newline at end of file +} diff --git a/src/Requests/StoreRecurrence.php b/src/Requests/StoreRecurrence.php index 04c4c4b..bd1e864 100644 --- a/src/Requests/StoreRecurrence.php +++ b/src/Requests/StoreRecurrence.php @@ -6,16 +6,14 @@ class StoreRecurrence extends PersistResource { - protected $persistAttributes = [ - "type" => "nullable|integer|in:1,2,3", - "repeat_interval" => "nullable|integer", - "weekly_days" => "nullable|string", - "monthly_day" => "nullable|numeric|between:1,31", - "monthly_week" => "nullable|numeric|in:-1,1,2,3,4", - "monthly_week_day" => "nullable|integer|in:1,2,3,4,5,6,7", - "end_times" => "nullable|numeric|max:50|exclude_unless:end_date_time,null", - "end_date_time" => "nullable|date|exclude_unless:end_times,null", + "type" => "nullable|integer|in:1,2,3", + "repeat_interval" => "nullable|integer", + "weekly_days" => "nullable|string", + "monthly_day" => "nullable|numeric|between:1,31", + "monthly_week" => "nullable|numeric|in:-1,1,2,3,4", + "monthly_week_day" => "nullable|integer|in:1,2,3,4,5,6,7", + "end_times" => "nullable|numeric|max:50|exclude_unless:end_date_time,null", + "end_date_time" => "nullable|date|exclude_unless:end_times,null", ]; - } diff --git a/src/Requests/StoreRegistrant.php b/src/Requests/StoreRegistrant.php index 8225eed..65e330d 100644 --- a/src/Requests/StoreRegistrant.php +++ b/src/Requests/StoreRegistrant.php @@ -6,17 +6,16 @@ class StoreRegistrant extends PersistResource { - protected $persistAttributes = [ "email" => "required|email", "first_name" => "required|string|max:64", "last_name" => "nullable|string|max:64", - "address"=> "nullable|string|max:64", - "city"=> "nullable|string|max:64", - "country"=> "nullable|string|max:64", - "zip"=> "nullable|string|max:20", - "state"=> "nullable|string|max:64", - "phone"=> "nullable|string|max:64", + "address" => "nullable|string|max:64", + "city" => "nullable|string|max:64", + "country" => "nullable|string|max:64", + "zip" => "nullable|string|max:20", + "state" => "nullable|string|max:64", + "phone" => "nullable|string|max:64", "industry" => "nullable|string|max:64", "org" => "nullable|string|max:64", "job_title" => "nullable|string|max:64", @@ -27,7 +26,6 @@ class StoreRegistrant extends PersistResource ]; protected $relatedResource = [ - "custom_questions" => StoreCustomQuestion::class + "custom_questions" => StoreCustomQuestion::class, ]; - } diff --git a/src/Requests/StoreRegistrantCustomQuestion.php b/src/Requests/StoreRegistrantCustomQuestion.php index 76749b5..094b6d9 100644 --- a/src/Requests/StoreRegistrantCustomQuestion.php +++ b/src/Requests/StoreRegistrantCustomQuestion.php @@ -6,9 +6,8 @@ class StoreRegistrantCustomQuestion extends PersistResource { - protected $persistAttributes = [ - "title" => "nullable|string", - "value" => "nullable|string", + "title" => "nullable|string", + "value" => "nullable|string", ]; -} \ No newline at end of file +} diff --git a/src/Requests/StoreRole.php b/src/Requests/StoreRole.php index 2a55dc1..27917ee 100644 --- a/src/Requests/StoreRole.php +++ b/src/Requests/StoreRole.php @@ -6,11 +6,9 @@ class StoreRole extends PersistResource { - protected $persistAttributes = [ - 'name' => 'required|string|max:128', - 'description' => 'required|string|max:128', - 'privileges' => 'required|array', + 'name' => 'required|string|max:128', + 'description' => 'required|string|max:128', + 'privileges' => 'required|array', ]; - } diff --git a/src/Requests/StoreTrackingField.php b/src/Requests/StoreTrackingField.php index efdea7c..c2395bb 100644 --- a/src/Requests/StoreTrackingField.php +++ b/src/Requests/StoreTrackingField.php @@ -6,10 +6,8 @@ class StoreTrackingField extends PersistResource { - protected $persistAttributes = [ - "field" => "nullable|string", - "value" => "nullable|string", + "field" => "nullable|string", + "value" => "nullable|string", ]; - } diff --git a/src/Requests/StoreUser.php b/src/Requests/StoreUser.php index 89a9791..1a5107b 100644 --- a/src/Requests/StoreUser.php +++ b/src/Requests/StoreUser.php @@ -6,22 +6,20 @@ class StoreUser extends PersistResource { - protected $persistAttributes = [ - 'action' => 'required|in:create,autoCreate,custCreate,ssoCreate', - 'user_info.email' => 'required|email|max:128', - 'user_info.type' => 'required|in:1,2,3', - 'user_info.first_name' => 'nullable|string|max:64', - 'user_info.last_name' => 'nullable|string|max:64', - 'user_info.password' => 'nullable|between:8,32' + 'action' => 'required|in:create,autoCreate,custCreate,ssoCreate', + 'user_info.email' => 'required|email|max:128', + 'user_info.type' => 'required|in:1,2,3', + 'user_info.first_name' => 'nullable|string|max:64', + 'user_info.last_name' => 'nullable|string|max:64', + 'user_info.password' => 'nullable|between:8,32', ]; protected $mutateAttributes = [ - 'email' => 'user_info.email', - 'type' => 'user_info.type', - 'first_name' => 'user_info.first_name', - 'last_name' => 'user_info.last_name', - 'password' => 'user_info.password', + 'email' => 'user_info.email', + 'type' => 'user_info.type', + 'first_name' => 'user_info.first_name', + 'last_name' => 'user_info.last_name', + 'password' => 'user_info.password', ]; - } diff --git a/src/Requests/StoreWebinar.php b/src/Requests/StoreWebinar.php index 557a5f3..dbadee6 100644 --- a/src/Requests/StoreWebinar.php +++ b/src/Requests/StoreWebinar.php @@ -6,21 +6,19 @@ class StoreWebinar extends PersistResource { - protected $persistAttributes = [ - 'topic' => 'nullable|string', - 'type' => 'nullable|integer|in:5,6,9', - 'start_time' => 'nullable|date', - 'duration' => 'nullable|integer', - 'timezone' => 'nullable|string', - 'password' => 'nullable|string|max:10', - 'agenda' => 'nullable|string|max:2000' + 'topic' => 'nullable|string', + 'type' => 'nullable|integer|in:5,6,9', + 'start_time' => 'nullable|date', + 'duration' => 'nullable|integer', + 'timezone' => 'nullable|string', + 'password' => 'nullable|string|max:10', + 'agenda' => 'nullable|string|max:2000', ]; protected $relatedResource = [ - "settings" => StoreWebinarSetting::class, - "recurrence" => StoreRecurrence::class, - "tracking_fields" => StoreTrackingField::class + "settings" => StoreWebinarSetting::class, + "recurrence" => StoreRecurrence::class, + "tracking_fields" => StoreTrackingField::class, ]; - } diff --git a/src/Requests/StoreWebinarSetting.php b/src/Requests/StoreWebinarSetting.php index 132ff26..15c5613 100644 --- a/src/Requests/StoreWebinarSetting.php +++ b/src/Requests/StoreWebinarSetting.php @@ -6,36 +6,34 @@ class StoreWebinarSetting extends PersistResource { - protected $persistAttributes = [ - "host_video" => "nullable|boolean", - "panelist_video" => "nullable|boolean", - "practice_video" => "nullable|boolean", - "hd_video" => "nullable|boolean", - "approval_type" => "nullable|in:0,1,2", - "registration_type" => "nullable|in:1,2,3", - "audio" => "nullable|in:both,telephony,voip", - "auto_recording" => "nullable|in:local,cloud,none", - "enforce_login" => "nullable|boolean", - "enforce_login_domains" => "nullable|string", - "alternative_hosts" => "nullable|string", - "close_registration" => "nullable|boolean", - "show_share_button" => "nullable|boolean", - "allow_multiple_devices" => "nullable|boolean", - "on_demand" => "nullable|boolean", - "contact_name" => "nullable|string", - "contact_email" => "nullable|string", - "registrants_restrict_number" => "nullable|numeric|max:20000", - "post_webinar_survey" => "nullable|boolean", - "survey_url" => "nullable|string", - "registrants_email_notification" => "nullable|boolean", - "meeting_authentication" => "nullable|boolean", - "authentication_option" => "nullable|string", - "authentication_domains" => "nullable|string", + "host_video" => "nullable|boolean", + "panelist_video" => "nullable|boolean", + "practice_video" => "nullable|boolean", + "hd_video" => "nullable|boolean", + "approval_type" => "nullable|in:0,1,2", + "registration_type" => "nullable|in:1,2,3", + "audio" => "nullable|in:both,telephony,voip", + "auto_recording" => "nullable|in:local,cloud,none", + "enforce_login" => "nullable|boolean", + "enforce_login_domains" => "nullable|string", + "alternative_hosts" => "nullable|string", + "close_registration" => "nullable|boolean", + "show_share_button" => "nullable|boolean", + "allow_multiple_devices" => "nullable|boolean", + "on_demand" => "nullable|boolean", + "contact_name" => "nullable|string", + "contact_email" => "nullable|string", + "registrants_restrict_number" => "nullable|numeric|max:20000", + "post_webinar_survey" => "nullable|boolean", + "survey_url" => "nullable|string", + "registrants_email_notification" => "nullable|boolean", + "meeting_authentication" => "nullable|boolean", + "authentication_option" => "nullable|string", + "authentication_domains" => "nullable|string", ]; protected $relatedResource = [ - "global_dial_in_countries" => StoreGlobalDialInCountry::class + "global_dial_in_countries" => StoreGlobalDialInCountry::class, ]; - } diff --git a/src/Requests/UpdateAccount.php b/src/Requests/UpdateAccount.php index 5339c08..ffb03f1 100644 --- a/src/Requests/UpdateAccount.php +++ b/src/Requests/UpdateAccount.php @@ -6,9 +6,7 @@ class UpdateAccount extends PersistResource { - protected $persistAttributes = [ - + ]; - } diff --git a/src/Requests/UpdateAssistant.php b/src/Requests/UpdateAssistant.php index a4cee44..4b1c924 100644 --- a/src/Requests/UpdateAssistant.php +++ b/src/Requests/UpdateAssistant.php @@ -6,10 +6,8 @@ class UpdateAssistant extends PersistResource { - protected $persistAttributes = [ - 'id' => '', - 'email' => 'nullable|email', + 'id' => '', + 'email' => 'nullable|email', ]; - } diff --git a/src/Requests/UpdateCustomQuestion.php b/src/Requests/UpdateCustomQuestion.php index 61d5660..7fb4a3f 100644 --- a/src/Requests/UpdateCustomQuestion.php +++ b/src/Requests/UpdateCustomQuestion.php @@ -6,11 +6,10 @@ class UpdateCustomQuestion extends PersistResource { - protected $persistAttributes = [ - "title" => "nullable|string", - "type" => "nullable|string|in:short,single", - 'required' => 'nullable|boolean', - 'answers' => 'nullable|array' + "title" => "nullable|string", + "type" => "nullable|string|in:short,single", + 'required' => 'nullable|boolean', + 'answers' => 'nullable|array', ]; -} \ No newline at end of file +} diff --git a/src/Requests/UpdateEmailNotification.php b/src/Requests/UpdateEmailNotification.php index 3c0cc47..56b65a1 100644 --- a/src/Requests/UpdateEmailNotification.php +++ b/src/Requests/UpdateEmailNotification.php @@ -6,12 +6,10 @@ class UpdateEmailNotification extends PersistResource { - protected $persistAttributes = [ - "jbh_reminder" => "nullable|boolean", - "cancel_meeting_reminder" => "nullable|boolean", - "alternative_host_reminder" => "nullable|boolean", - "schedule_for_reminder" => "nullable|boolean" + "jbh_reminder" => "nullable|boolean", + "cancel_meeting_reminder" => "nullable|boolean", + "alternative_host_reminder" => "nullable|boolean", + "schedule_for_reminder" => "nullable|boolean", ]; - } diff --git a/src/Requests/UpdateFeature.php b/src/Requests/UpdateFeature.php index 06bc746..a105931 100644 --- a/src/Requests/UpdateFeature.php +++ b/src/Requests/UpdateFeature.php @@ -6,14 +6,12 @@ class UpdateFeature extends PersistResource { - protected $persistAttributes = [ - "meeting_capacity" => "nullable|numeric", - "large_meeting" => "nullable|boolean", - "large_meeting_capacity" => "nullable|numeric", - "webinar" => "nullable|boolean", - "webinar_capacity" => "nullable|numeric", - "zoom_phone" => "nullable|boolean" + "meeting_capacity" => "nullable|numeric", + "large_meeting" => "nullable|boolean", + "large_meeting_capacity" => "nullable|numeric", + "webinar" => "nullable|boolean", + "webinar_capacity" => "nullable|numeric", + "zoom_phone" => "nullable|boolean", ]; - } diff --git a/src/Requests/UpdateGlobalDialInCountry.php b/src/Requests/UpdateGlobalDialInCountry.php index e7a4ee2..d51f277 100644 --- a/src/Requests/UpdateGlobalDialInCountry.php +++ b/src/Requests/UpdateGlobalDialInCountry.php @@ -6,13 +6,11 @@ class UpdateGlobalDialInCountry extends PersistResource { - protected $persistAttributes = [ - "city" => "nullable|string", - "country" => "nullable|string", - "country_name" => "nullable|string", - "number" => "nullable|string", - "type" => "nullable|in:toll,tollfree" + "city" => "nullable|string", + "country" => "nullable|string", + "country_name" => "nullable|string", + "number" => "nullable|string", + "type" => "nullable|in:toll,tollfree", ]; - } diff --git a/src/Requests/UpdateGlobalDialInNumber.php b/src/Requests/UpdateGlobalDialInNumber.php index d257935..71a85a3 100644 --- a/src/Requests/UpdateGlobalDialInNumber.php +++ b/src/Requests/UpdateGlobalDialInNumber.php @@ -6,13 +6,11 @@ class UpdateGlobalDialInNumber extends PersistResource { - protected $persistAttributes = [ - "city" => "nullable|string", - "country" => "nullable|string", - "country_name" => "nullable|string", - "number" => "nullable|string", - "type" => "nullable|in:toll,tollfree" + "city" => "nullable|string", + "country" => "nullable|string", + "country_name" => "nullable|string", + "number" => "nullable|string", + "type" => "nullable|in:toll,tollfree", ]; - } diff --git a/src/Requests/UpdateInMeeting.php b/src/Requests/UpdateInMeeting.php index 401bc86..e2efd17 100644 --- a/src/Requests/UpdateInMeeting.php +++ b/src/Requests/UpdateInMeeting.php @@ -6,38 +6,37 @@ class UpdateInMeeting extends PersistResource { - protected $persistAttributes = [ - "e2e_encryption" => "nullable|boolean", - "chat" => "nullable|boolean", - "private_chat" => "nullable|numeric", - "auto_saving_chat" => "nullable|boolean", - "entry_exit_chime" => "nullable|in:host,all,none", - "record_play_voice" => "nullable|boolean", - "feedback" => "nullable|boolean", - "co_host" => "nullable|boolean", - "polling" => "nullable|boolean", - "attendee_on_hold" => "nullable|boolean", - "show_meeting_control_toolbar" => "nullable|boolean", - "annotation" => "nullable|boolean", - "remote_control" => "nullable|boolean", - "non_verbal_feedback" => "nullable|boolean", - "breakout_room" => "nullable|boolean", - "closed_caption" => "nullable|boolean", - "group_hd" => "nullable|boolean", - "virtual_background" => "nullable|boolean", - "far_end_camera_control" => "nullable|boolean", - "custom_data_center_regions" => "nullable|boolean", - "waiting_room" => "nullable|boolean", - "guest_only_to_place_in_waiting_room" => "nullable|boolean", - "allow_live_streaming" => "nullable|boolean", - "auto_admit_participants_with_specified_domains" => "nullable|boolean", - "admit_participants_with_specified_domains" => "nullable|string", - "workplace_by_facebook" => "nullable|boolean", - "custom_live_streaming_service" => "nullable|boolean", - "custom_service_instructions" => "nullable|string", - "show_meeting_control_toolbar" => "nullable|boolean", - "custom_data_center_regions" => "nullable|boolean", - "data_center_regions" => "nullable|array", + "e2e_encryption" => "nullable|boolean", + "chat" => "nullable|boolean", + "private_chat" => "nullable|numeric", + "auto_saving_chat" => "nullable|boolean", + "entry_exit_chime" => "nullable|in:host,all,none", + "record_play_voice" => "nullable|boolean", + "feedback" => "nullable|boolean", + "co_host" => "nullable|boolean", + "polling" => "nullable|boolean", + "attendee_on_hold" => "nullable|boolean", + "show_meeting_control_toolbar" => "nullable|boolean", + "annotation" => "nullable|boolean", + "remote_control" => "nullable|boolean", + "non_verbal_feedback" => "nullable|boolean", + "breakout_room" => "nullable|boolean", + "closed_caption" => "nullable|boolean", + "group_hd" => "nullable|boolean", + "virtual_background" => "nullable|boolean", + "far_end_camera_control" => "nullable|boolean", + "custom_data_center_regions" => "nullable|boolean", + "waiting_room" => "nullable|boolean", + "guest_only_to_place_in_waiting_room" => "nullable|boolean", + "allow_live_streaming" => "nullable|boolean", + "auto_admit_participants_with_specified_domains" => "nullable|boolean", + "admit_participants_with_specified_domains" => "nullable|string", + "workplace_by_facebook" => "nullable|boolean", + "custom_live_streaming_service" => "nullable|boolean", + "custom_service_instructions" => "nullable|string", + "show_meeting_control_toolbar" => "nullable|boolean", + "custom_data_center_regions" => "nullable|boolean", + "data_center_regions" => "nullable|array", ]; } diff --git a/src/Requests/UpdateIntegration.php b/src/Requests/UpdateIntegration.php index 793a1cd..9365828 100644 --- a/src/Requests/UpdateIntegration.php +++ b/src/Requests/UpdateIntegration.php @@ -6,8 +6,7 @@ class UpdateIntegration extends PersistResource { - protected $persistAttributes = [ - "linkedin_sales_navigator" => "nullable|boolean", + "linkedin_sales_navigator" => "nullable|boolean", ]; } diff --git a/src/Requests/UpdateLiveStream.php b/src/Requests/UpdateLiveStream.php index 6966dcc..b4b410e 100644 --- a/src/Requests/UpdateLiveStream.php +++ b/src/Requests/UpdateLiveStream.php @@ -6,10 +6,9 @@ class UpdateLiveStream extends PersistResource { - protected $persistAttributes = [ - "stream_url" => "required|string|max:1024", - "stream_key" => "required|string|max:512", - "page_url" => "nullable|string|max:1024" - ]; -} \ No newline at end of file + "stream_url" => "required|string|max:1024", + "stream_key" => "required|string|max:512", + "page_url" => "nullable|string|max:1024", + ]; +} diff --git a/src/Requests/UpdateLiveStreamStatus.php b/src/Requests/UpdateLiveStreamStatus.php index 8fc6009..f63e4e4 100644 --- a/src/Requests/UpdateLiveStreamStatus.php +++ b/src/Requests/UpdateLiveStreamStatus.php @@ -6,12 +6,11 @@ class UpdateLiveStreamStatus extends PersistResource { - protected $persistAttributes = [ - "action" => "required|in:start,stop", - ]; + "action" => "required|in:start,stop", + ]; - protected $relatedResource = [ - "settings" => UpdateLiveStreamStatusSetting::class, + protected $relatedResource = [ + "settings" => UpdateLiveStreamStatusSetting::class, ]; -} \ No newline at end of file +} diff --git a/src/Requests/UpdateLiveStreamStatusSetting.php b/src/Requests/UpdateLiveStreamStatusSetting.php index 173bb35..d472139 100644 --- a/src/Requests/UpdateLiveStreamStatusSetting.php +++ b/src/Requests/UpdateLiveStreamStatusSetting.php @@ -6,9 +6,8 @@ class UpdateLiveStreamStatusSetting extends PersistResource { - protected $persistAttributes = [ - "active_speaker_name" => "nullable|boolean", - "display_name" => "nullable|string|between:1,50", - ]; -} \ No newline at end of file + "active_speaker_name" => "nullable|boolean", + "display_name" => "nullable|string|between:1,50", + ]; +} diff --git a/src/Requests/UpdateMeeting.php b/src/Requests/UpdateMeeting.php index 4b5612b..337d53f 100644 --- a/src/Requests/UpdateMeeting.php +++ b/src/Requests/UpdateMeeting.php @@ -6,22 +6,20 @@ class UpdateMeeting extends PersistResource { - protected $persistAttributes = [ - 'topic' => 'nullable|string', - 'type' => 'nullable|integer|in:1,2,3,8', - 'start_time' => 'nullable|date', - 'duration' => 'nullable|integer', - 'timezone' => 'nullable|string', - 'password' => 'nullable|string|max:10', - 'schedule_for' => 'nullable|string', - 'agenda' => 'nullable|string|max:2000' + 'topic' => 'nullable|string', + 'type' => 'nullable|integer|in:1,2,3,8', + 'start_time' => 'nullable|date', + 'duration' => 'nullable|integer', + 'timezone' => 'nullable|string', + 'password' => 'nullable|string|max:10', + 'schedule_for' => 'nullable|string', + 'agenda' => 'nullable|string|max:2000', ]; protected $relatedResource = [ - "settings" => UpdateMeetingSetting::class, - "recurrence" => UpdateRecurrence::class, - "tracking_fields" => UpdateTrackingField::class + "settings" => UpdateMeetingSetting::class, + "recurrence" => UpdateRecurrence::class, + "tracking_fields" => UpdateTrackingField::class, ]; - } diff --git a/src/Requests/UpdateMeetingPasswordRequirement.php b/src/Requests/UpdateMeetingPasswordRequirement.php index 9e91721..c1c6682 100644 --- a/src/Requests/UpdateMeetingPasswordRequirement.php +++ b/src/Requests/UpdateMeetingPasswordRequirement.php @@ -6,12 +6,11 @@ class UpdateMeetingPasswordRequirement extends PersistResource { - protected $persistAttributes = [ - "length" => "nullable|string|max:10", - "have_letter" => "nullable|boolean", - "have_number" => "nullable|boolean", - "have_special_character" => "nullable|boolean", - "only_allow_numeric" => "nullable|boolean", + "length" => "nullable|string|max:10", + "have_letter" => "nullable|boolean", + "have_number" => "nullable|boolean", + "have_special_character" => "nullable|boolean", + "only_allow_numeric" => "nullable|boolean", ]; -} \ No newline at end of file +} diff --git a/src/Requests/UpdateMeetingSetting.php b/src/Requests/UpdateMeetingSetting.php index 2c0e198..954c112 100644 --- a/src/Requests/UpdateMeetingSetting.php +++ b/src/Requests/UpdateMeetingSetting.php @@ -6,38 +6,36 @@ class UpdateMeetingSetting extends PersistResource { - protected $persistAttributes = [ - "host_video" => "nullable|boolean", - "participant_video" => "nullable|boolean", - "cn_meeting" => "nullable|boolean", - "in_meeting" => "nullable|boolean", - "join_before_host" => "nullable|boolean", - "mute_upon_entry" => "nullable|boolean", - "watermark" => "nullable|boolean", - "use_pmi" => "nullable|boolean", - "approval_type" => "nullable|in:0,1,2", - "registration_type" => "nullable|in:1,2,3", - "audio" => "nullable|in:both,telephony,voip", - "local_recording" => "nullable|in:local,cloud,none", - "enforce_login" => "nullable|boolean", - "enforce_login_domains" => "nullable|string", - "alternative_hosts" => "nullable|string", - "close_registration" => "nullable|boolean", - "waiting_room" => "nullable|boolean", - "contact_name" => "nullable|string", - "contact_email" => "nullable|string", - "registrants_confirmation_email" => "nullable|boolean", - "registrants_email_notification" => "nullable|boolean", - "meeting_authentication" => "nullable|boolean", - "authentication_option" => "nullable|string", - "authentication_domains" => "nullable|string", - "authentication_name" => "nullable|string", + "host_video" => "nullable|boolean", + "participant_video" => "nullable|boolean", + "cn_meeting" => "nullable|boolean", + "in_meeting" => "nullable|boolean", + "join_before_host" => "nullable|boolean", + "mute_upon_entry" => "nullable|boolean", + "watermark" => "nullable|boolean", + "use_pmi" => "nullable|boolean", + "approval_type" => "nullable|in:0,1,2", + "registration_type" => "nullable|in:1,2,3", + "audio" => "nullable|in:both,telephony,voip", + "local_recording" => "nullable|in:local,cloud,none", + "enforce_login" => "nullable|boolean", + "enforce_login_domains" => "nullable|string", + "alternative_hosts" => "nullable|string", + "close_registration" => "nullable|boolean", + "waiting_room" => "nullable|boolean", + "contact_name" => "nullable|string", + "contact_email" => "nullable|string", + "registrants_confirmation_email" => "nullable|boolean", + "registrants_email_notification" => "nullable|boolean", + "meeting_authentication" => "nullable|boolean", + "authentication_option" => "nullable|string", + "authentication_domains" => "nullable|string", + "authentication_name" => "nullable|string", ]; protected $relatedResource = [ - "global_dial_in_countries" => UpdateGlobalDialInCountry::class, - "global_dial_in_numbers" => UpdateGlobalDialInNumber::class + "global_dial_in_countries" => UpdateGlobalDialInCountry::class, + "global_dial_in_numbers" => UpdateGlobalDialInNumber::class, ]; - } diff --git a/src/Requests/UpdateOccurrence.php b/src/Requests/UpdateOccurrence.php index 0c1f46b..50a99b6 100644 --- a/src/Requests/UpdateOccurrence.php +++ b/src/Requests/UpdateOccurrence.php @@ -6,11 +6,10 @@ class UpdateOccurrence extends PersistResource { - protected $persistAttributes = [ - 'start_time' => 'nullable|date', - 'duration' => 'nullable|integer', - 'agenda' => 'nullable|string|max:2000', + 'start_time' => 'nullable|date', + 'duration' => 'nullable|integer', + 'agenda' => 'nullable|string|max:2000', 'settings.host_video' => 'nullable|boolean', 'settings.panelists_video' => 'nullable|boolean', 'settings.hd_video' => 'nullable|boolean', @@ -21,5 +20,4 @@ class UpdateOccurrence extends PersistResource 'settings.mute_upon_entry' => 'nullable|boolean', 'settings.waiting_room' => 'nullable|boolean', ]; - } diff --git a/src/Requests/UpdatePoll.php b/src/Requests/UpdatePoll.php index 8e352f0..ad95def 100644 --- a/src/Requests/UpdatePoll.php +++ b/src/Requests/UpdatePoll.php @@ -6,13 +6,11 @@ class UpdatePoll extends PersistResource { - protected $persistAttributes = [ - 'title' => 'nullable|string', + 'title' => 'nullable|string', ]; protected $relatedResource = [ - "questions" => UpdatePollQuestion::class + "questions" => UpdatePollQuestion::class, ]; - -} \ No newline at end of file +} diff --git a/src/Requests/UpdatePollQuestion.php b/src/Requests/UpdatePollQuestion.php index fc0c4fc..975e2a5 100644 --- a/src/Requests/UpdatePollQuestion.php +++ b/src/Requests/UpdatePollQuestion.php @@ -6,11 +6,9 @@ class UpdatePollQuestion extends PersistResource { - protected $persistAttributes = [ - 'name' => 'nullable|string', - 'type' => 'nullable|in:single,multiple', - 'answers' => 'nullable|array' + 'name' => 'nullable|string', + 'type' => 'nullable|in:single,multiple', + 'answers' => 'nullable|array', ]; - -} \ No newline at end of file +} diff --git a/src/Requests/UpdateQuestion.php b/src/Requests/UpdateQuestion.php index 32e15c3..1122785 100644 --- a/src/Requests/UpdateQuestion.php +++ b/src/Requests/UpdateQuestion.php @@ -6,9 +6,8 @@ class UpdateQuestion extends PersistResource { - protected $persistAttributes = [ - "field_name" => "nullable|string|in:address,city,country,zip,state,phone,industry,org,job_title,purchasing_time_frame,role_in_purchase_process,no_of_employees,comments", - "required" => "nullable|boolean" + "field_name" => "nullable|string|in:address,city,country,zip,state,phone,industry,org,job_title,purchasing_time_frame,role_in_purchase_process,no_of_employees,comments", + "required" => "nullable|boolean", ]; -} \ No newline at end of file +} diff --git a/src/Requests/UpdateRecording.php b/src/Requests/UpdateRecording.php index 7d27fb2..aaeaff6 100644 --- a/src/Requests/UpdateRecording.php +++ b/src/Requests/UpdateRecording.php @@ -6,23 +6,22 @@ class UpdateRecording extends PersistResource { - protected $persistAttributes = [ - "local_recording" => "nullable|boolean", - "cloud_recording" => "nullable|boolean", - "record_speaker_view" => "nullable|boolean", - "record_gallery_view" => "nullable|boolean", - "record_audio_file" => "nullable|boolean", - "save_chat_text" => "nullable|boolean", - "show_timestamp" => "nullable|boolean", - "recording_audio_transcript" => "nullable|boolean", - "auto_recording" => "nullable|in:none,local,cloud", - "auto_delete_cmr" => "nullable|boolean", - "host_pause_stop_recording" => "nullable|boolean", - "auto_delete_cmr_days" => "nullable|numeric|between:1,60" + "local_recording" => "nullable|boolean", + "cloud_recording" => "nullable|boolean", + "record_speaker_view" => "nullable|boolean", + "record_gallery_view" => "nullable|boolean", + "record_audio_file" => "nullable|boolean", + "save_chat_text" => "nullable|boolean", + "show_timestamp" => "nullable|boolean", + "recording_audio_transcript" => "nullable|boolean", + "auto_recording" => "nullable|in:none,local,cloud", + "auto_delete_cmr" => "nullable|boolean", + "host_pause_stop_recording" => "nullable|boolean", + "auto_delete_cmr_days" => "nullable|numeric|between:1,60", ]; protected $relatedResource = [ - "recording_password_requirement" => UpdateRecordingPasswordRequirement::class + "recording_password_requirement" => UpdateRecordingPasswordRequirement::class, ]; -} \ No newline at end of file +} diff --git a/src/Requests/UpdateRecordingPasswordRequirement.php b/src/Requests/UpdateRecordingPasswordRequirement.php index 4924ec6..cbbff35 100644 --- a/src/Requests/UpdateRecordingPasswordRequirement.php +++ b/src/Requests/UpdateRecordingPasswordRequirement.php @@ -6,12 +6,11 @@ class UpdateRecordingPasswordRequirement extends PersistResource { - protected $persistAttributes = [ - "length" => "nullable|string|max:10", - "have_letter" => "nullable|boolean", - "have_number" => "nullable|boolean", - "have_special_character" => "nullable|boolean", - "only_allow_numeric" => "nullable|boolean", + "length" => "nullable|string|max:10", + "have_letter" => "nullable|boolean", + "have_number" => "nullable|boolean", + "have_special_character" => "nullable|boolean", + "only_allow_numeric" => "nullable|boolean", ]; -} \ No newline at end of file +} diff --git a/src/Requests/UpdateRecurrence.php b/src/Requests/UpdateRecurrence.php index 304f227..3c00ce3 100644 --- a/src/Requests/UpdateRecurrence.php +++ b/src/Requests/UpdateRecurrence.php @@ -6,16 +6,14 @@ class UpdateRecurrence extends PersistResource { - protected $persistAttributes = [ - "type" => "nullable|integer|in:1,2,3", - "repeat_interval" => "nullable|integer", - "weekly_days" => "nullable|string", - "monthly_day" => "nullable|numeric|between:1,31", - "monthly_week" => "nullable|numeric|in:-1,1,2,3,4", - "monthly_week_day" => "nullable|integer|in:1,2,3,4,5,6,7", - "end_times" => "nullable|numeric|max:50|exclude_unless:end_date_time,null", - "end_date_time" => "nullable|date|exclude_unless:end_times,null" + "type" => "nullable|integer|in:1,2,3", + "repeat_interval" => "nullable|integer", + "weekly_days" => "nullable|string", + "monthly_day" => "nullable|numeric|between:1,31", + "monthly_week" => "nullable|numeric|in:-1,1,2,3,4", + "monthly_week_day" => "nullable|integer|in:1,2,3,4,5,6,7", + "end_times" => "nullable|numeric|max:50|exclude_unless:end_date_time,null", + "end_date_time" => "nullable|date|exclude_unless:end_times,null", ]; - } diff --git a/src/Requests/UpdateRegistrationQuestion.php b/src/Requests/UpdateRegistrationQuestion.php index a898d07..0b15eb9 100644 --- a/src/Requests/UpdateRegistrationQuestion.php +++ b/src/Requests/UpdateRegistrationQuestion.php @@ -6,10 +6,8 @@ class UpdateRegistrationQuestion extends PersistResource { - protected $relatedResource = [ - "questions" => UpdateQuestion::class, - "custom_questions" => UpdateCustomQuestion::class + "questions" => UpdateQuestion::class, + "custom_questions" => UpdateCustomQuestion::class, ]; - -} \ No newline at end of file +} diff --git a/src/Requests/UpdateRole.php b/src/Requests/UpdateRole.php index f166e78..9ddeabb 100644 --- a/src/Requests/UpdateRole.php +++ b/src/Requests/UpdateRole.php @@ -6,11 +6,9 @@ class UpdateRole extends PersistResource { - protected $persistAttributes = [ - 'name' => 'nullable|string|max:128', - 'description' => 'nullable|string|max:128', - 'privileges' => 'nullable|array', + 'name' => 'nullable|string|max:128', + 'description' => 'nullable|string|max:128', + 'privileges' => 'nullable|array', ]; - } diff --git a/src/Requests/UpdateScheduleMeeting.php b/src/Requests/UpdateScheduleMeeting.php index 6895ba3..f1f124a 100644 --- a/src/Requests/UpdateScheduleMeeting.php +++ b/src/Requests/UpdateScheduleMeeting.php @@ -6,30 +6,28 @@ class UpdateScheduleMeeting extends PersistResource { - protected $persistAttributes = [ - "host_video" => "nullable|boolean", - "participants_video" => "nullable|boolean", - "audio_type" => "nullable|in:both,telephony,voip,thirdParty", - "join_before_host" => "nullable|boolean", - "use_pmi_for_scheduled_meetings" => "nullable|boolean", - "use_pmi_for_instant_meetings" => "nullable|boolean", - "enforce_login_with_domains" => "nullable|boolean", - "enforce_login_domains" => "nullable|boolean", - "not_store_meeting_topic" => "nullable|boolean", - "force_pmi_jbh_password" => "nullable|boolean", - "require_password_for_instant_meetings" => "nullable|boolean", - "require_password_for_pmi_meetings" => "nullable|in:jbh_only,all,none", - "require_password_for_scheduling_new_meetings" => "nullable|boolean", - 'require_password_for_scheduled_meetings' => "nullable|boolean", - "pmi_password" => "nullable|string", - "pstn_password_protected" => "nullable|boolean", - "default_password_for_scheduled_meetings" => "nullable|string", - "personal_meeting" => "nullable|boolean", + "host_video" => "nullable|boolean", + "participants_video" => "nullable|boolean", + "audio_type" => "nullable|in:both,telephony,voip,thirdParty", + "join_before_host" => "nullable|boolean", + "use_pmi_for_scheduled_meetings" => "nullable|boolean", + "use_pmi_for_instant_meetings" => "nullable|boolean", + "enforce_login_with_domains" => "nullable|boolean", + "enforce_login_domains" => "nullable|boolean", + "not_store_meeting_topic" => "nullable|boolean", + "force_pmi_jbh_password" => "nullable|boolean", + "require_password_for_instant_meetings" => "nullable|boolean", + "require_password_for_pmi_meetings" => "nullable|in:jbh_only,all,none", + "require_password_for_scheduling_new_meetings" => "nullable|boolean", + 'require_password_for_scheduled_meetings' => "nullable|boolean", + "pmi_password" => "nullable|string", + "pstn_password_protected" => "nullable|boolean", + "default_password_for_scheduled_meetings" => "nullable|string", + "personal_meeting" => "nullable|boolean", ]; protected $relatedResource = [ - "meeting_password_requirement" => UpdateMeetingPasswordRequirement::class + "meeting_password_requirement" => UpdateMeetingPasswordRequirement::class, ]; - -} \ No newline at end of file +} diff --git a/src/Requests/UpdateSetting.php b/src/Requests/UpdateSetting.php index d43dd9c..a07abca 100644 --- a/src/Requests/UpdateSetting.php +++ b/src/Requests/UpdateSetting.php @@ -6,7 +6,6 @@ class UpdateSetting extends PersistResource { - protected $relatedResource = [ "email_notification" => UpdateEmailNotification::class, "feature" => UpdateFeature::class, @@ -15,6 +14,6 @@ class UpdateSetting extends PersistResource "recording" => UpdateRecording::class, "schedule_meeting" => UpdateScheduleMeeting::class, "telephony" => UpdateTelephony::class, - "tsp" => UpdateTsp::class + "tsp" => UpdateTsp::class, ]; -} \ No newline at end of file +} diff --git a/src/Requests/UpdateTelephony.php b/src/Requests/UpdateTelephony.php index 79719ae..d90457f 100644 --- a/src/Requests/UpdateTelephony.php +++ b/src/Requests/UpdateTelephony.php @@ -6,10 +6,9 @@ class UpdateTelephony extends PersistResource { - protected $persistAttributes = [ - "third_party_audio" => "nullable|boolean", - "audio_conference_info" => "nullable|max:2048", - "show_international_numbers_link" => "nullable|boolean", + "third_party_audio" => "nullable|boolean", + "audio_conference_info" => "nullable|max:2048", + "show_international_numbers_link" => "nullable|boolean", ]; -} \ No newline at end of file +} diff --git a/src/Requests/UpdateTrackingField.php b/src/Requests/UpdateTrackingField.php index 35edf39..a86dd44 100644 --- a/src/Requests/UpdateTrackingField.php +++ b/src/Requests/UpdateTrackingField.php @@ -6,10 +6,8 @@ class UpdateTrackingField extends PersistResource { - protected $persistAttributes = [ - "field" => "nullable|string", - "value" => "nullable|string", + "field" => "nullable|string", + "value" => "nullable|string", ]; - } diff --git a/src/Requests/UpdateTsp.php b/src/Requests/UpdateTsp.php index 2abd06d..5ee7ade 100644 --- a/src/Requests/UpdateTsp.php +++ b/src/Requests/UpdateTsp.php @@ -6,10 +6,9 @@ class UpdateTsp extends PersistResource { - protected $persistAttributes = [ - "call_out" => "nullable|boolean", - "call_out_countries" => "nullable|array", - "show_international_numbers_link" => "nullable|boolean", + "call_out" => "nullable|boolean", + "call_out_countries" => "nullable|array", + "show_international_numbers_link" => "nullable|boolean", ]; -} \ No newline at end of file +} diff --git a/src/Requests/UpdateUser.php b/src/Requests/UpdateUser.php index 0f82870..1663bfc 100644 --- a/src/Requests/UpdateUser.php +++ b/src/Requests/UpdateUser.php @@ -6,24 +6,22 @@ class UpdateUser extends PersistResource { - protected $persistAttributes = [ - 'first_name' => 'nullable|string|max:64', - 'last_name' => 'nullable|string|max:64', - 'type' => 'nullable|in:1,2,3', - 'pmi' => 'nullable|size:10', - 'use_pmi' => 'nullable|boolean', - 'timezone' => '', - 'language' => '', - 'dept' => '', - 'vanity_name' => '', - 'host_key' => 'nullable|between:6,10', - 'cms_user_id' => '', - 'job_title' => 'nullable|max:128', - 'company' => 'nullable|max:255', - 'location' => 'nullable|max:256', - 'phone_number' => '', - 'phone_country' => '', + 'first_name' => 'nullable|string|max:64', + 'last_name' => 'nullable|string|max:64', + 'type' => 'nullable|in:1,2,3', + 'pmi' => 'nullable|size:10', + 'use_pmi' => 'nullable|boolean', + 'timezone' => '', + 'language' => '', + 'dept' => '', + 'vanity_name' => '', + 'host_key' => 'nullable|between:6,10', + 'cms_user_id' => '', + 'job_title' => 'nullable|max:128', + 'company' => 'nullable|max:255', + 'location' => 'nullable|max:256', + 'phone_number' => '', + 'phone_country' => '', ]; - } diff --git a/src/Requests/UpdateWebinar.php b/src/Requests/UpdateWebinar.php index fbaadc0..e1ecaf2 100644 --- a/src/Requests/UpdateWebinar.php +++ b/src/Requests/UpdateWebinar.php @@ -6,20 +6,19 @@ class UpdateWebinar extends PersistResource { - protected $persistAttributes = [ - 'topic' => 'nullable|string', - 'type' => 'nullable|integer|in:5,6,9', - 'start_time' => 'nullable|date', - 'duration' => 'nullable|integer', - 'timezone' => 'nullable|string', - 'password' => 'nullable|string|max:10', - 'agenda' => 'nullable|string|max:2000' + 'topic' => 'nullable|string', + 'type' => 'nullable|integer|in:5,6,9', + 'start_time' => 'nullable|date', + 'duration' => 'nullable|integer', + 'timezone' => 'nullable|string', + 'password' => 'nullable|string|max:10', + 'agenda' => 'nullable|string|max:2000', ]; protected $relatedResource = [ - "settings" => UpdateWebinarSetting::class, - "recurrence" => UpdateRecurrence::class, - "tracking_fields" => UpdateTrackingField::class + "settings" => UpdateWebinarSetting::class, + "recurrence" => UpdateRecurrence::class, + "tracking_fields" => UpdateTrackingField::class, ]; } diff --git a/src/Requests/UpdateWebinarSetting.php b/src/Requests/UpdateWebinarSetting.php index daa0c34..a057033 100644 --- a/src/Requests/UpdateWebinarSetting.php +++ b/src/Requests/UpdateWebinarSetting.php @@ -6,36 +6,34 @@ class UpdateWebinarSetting extends PersistResource { - protected $persistAttributes = [ - "host_video" => "nullable|boolean", - "panelist_video" => "nullable|boolean", - "practice_video" => "nullable|boolean", - "hd_video" => "nullable|boolean", - "approval_type" => "nullable|in:0,1,2", - "registration_type" => "nullable|in:1,2,3", - "audio" => "nullable|in:both,telephony,voip", - "auto_recording" => "nullable|in:local,cloud,none", - "enforce_login" => "nullable|boolean", - "enforce_login_domains" => "nullable|string", - "alternative_hosts" => "nullable|string", - "close_registration" => "nullable|boolean", - "show_share_button" => "nullable|boolean", - "allow_multiple_devices" => "nullable|boolean", - "on_demand" => "nullable|boolean", - "contact_name" => "nullable|string", - "contact_email" => "nullable|string", - "registrants_restrict_number" => "nullable|numeric|max:20000", - "post_webinar_survey" => "nullable|boolean", - "survey_url" => "nullable|string", - "registrants_email_notification" => "nullable|boolean", - "meeting_authentication" => "nullable|boolean", - "authentication_option" => "nullable|string", - "authentication_domains" => "nullable|string", + "host_video" => "nullable|boolean", + "panelist_video" => "nullable|boolean", + "practice_video" => "nullable|boolean", + "hd_video" => "nullable|boolean", + "approval_type" => "nullable|in:0,1,2", + "registration_type" => "nullable|in:1,2,3", + "audio" => "nullable|in:both,telephony,voip", + "auto_recording" => "nullable|in:local,cloud,none", + "enforce_login" => "nullable|boolean", + "enforce_login_domains" => "nullable|string", + "alternative_hosts" => "nullable|string", + "close_registration" => "nullable|boolean", + "show_share_button" => "nullable|boolean", + "allow_multiple_devices" => "nullable|boolean", + "on_demand" => "nullable|boolean", + "contact_name" => "nullable|string", + "contact_email" => "nullable|string", + "registrants_restrict_number" => "nullable|numeric|max:20000", + "post_webinar_survey" => "nullable|boolean", + "survey_url" => "nullable|string", + "registrants_email_notification" => "nullable|boolean", + "meeting_authentication" => "nullable|boolean", + "authentication_option" => "nullable|string", + "authentication_domains" => "nullable|string", ]; protected $relatedResource = [ - "global_dial_in_countries" => StoreGlobalDialInCountry::class + "global_dial_in_countries" => StoreGlobalDialInCountry::class, ]; - } diff --git a/src/Role.php b/src/Role.php index 451ef42..5308d40 100644 --- a/src/Role.php +++ b/src/Role.php @@ -15,21 +15,18 @@ class Role extends Model protected $apiDataField = ''; - protected $apiMultipleDataField = 'roles'; + protected $apiMultipleDataField = 'roles'; - public function members() + public function members() { - return $this->hasMany(User::class, 'members'); + return $this->hasMany(User::class, 'members'); } public function giveRoleTo($user) { - } public function removeRoleFrom($user) { - } - } diff --git a/src/ScheduleMeeting.php b/src/ScheduleMeeting.php index 88893a7..a5480b2 100644 --- a/src/ScheduleMeeting.php +++ b/src/ScheduleMeeting.php @@ -6,7 +6,7 @@ class ScheduleMeeting extends Resource { - public function recordingPasswordRequirement() + public function recordingPasswordRequirement() { return $this->hasOne(MeetingPasswordRequirement::class); } diff --git a/src/Scheduler.php b/src/Scheduler.php index 0dfbedc..13bba4c 100644 --- a/src/Scheduler.php +++ b/src/Scheduler.php @@ -15,7 +15,7 @@ class Scheduler extends Model protected $apiMultipleDataField = 'schedulers'; - public function user() + public function user() { return $this->belongsTo(User::class); } @@ -24,5 +24,4 @@ public function getApiMultipleDataField() { return $this->apiMultipleDataField; } - } diff --git a/src/Setting.php b/src/Setting.php index 3e9f408..e7161b2 100644 --- a/src/Setting.php +++ b/src/Setting.php @@ -19,42 +19,42 @@ public function user() return $this->belongsTo(User::class); } - public function emailNotification() + public function emailNotification() { return $this->hasOne(EmailNotification::class); } - public function feature() + public function feature() { return $this->hasOne(Feature::class); } - public function inMeeting() + public function inMeeting() { return $this->hasOne(InMeeting::class); } - public function integration() + public function integration() { return $this->hasOne(Integration::class); } - public function recording() + public function recording() { return $this->hasOne(Recording::class); } - public function scheduleMeeting() + public function scheduleMeeting() { return $this->hasOne(ScheduleMeeting::class); } - public function telephony() + public function telephony() { return $this->hasOne(Telephony::class); } - public function tsp() + public function tsp() { return $this->hasOne(Tsp::class); } @@ -63,5 +63,4 @@ public function getApiMultipleDataField() { return $this->apiMultipleDataField; } - -} \ No newline at end of file +} diff --git a/src/Support/Client.php b/src/Support/Client.php index eb9e984..7c39daa 100644 --- a/src/Support/Client.php +++ b/src/Support/Client.php @@ -6,5 +6,4 @@ class Client extends Factory { - -} \ No newline at end of file +} diff --git a/src/Support/Entry.php b/src/Support/Entry.php index b493c3e..b4da01c 100644 --- a/src/Support/Entry.php +++ b/src/Support/Entry.php @@ -2,9 +2,9 @@ namespace MacsiDigital\Zoom\Support; -use MacsiDigital\Zoom\Facades\Client; -use MacsiDigital\API\Support\Entry as ApiEntry; use MacsiDigital\API\Support\Authentication\JWT; +use MacsiDigital\API\Support\Entry as ApiEntry; +use MacsiDigital\Zoom\Facades\Client; class Entry extends ApiEntry { @@ -30,21 +30,20 @@ class Entry extends ApiEntry public function __construct() { - if(config('zoom.max_api_calls_per_request') != null){ + if (config('zoom.max_api_calls_per_request') != null) { $this->maxQueries = config('zoom.max_api_calls_per_request'); } } public function newRequest() - { - if(config('zoom.authentication_method') == 'jwt'){ + { + if (config('zoom.authentication_method') == 'jwt') { return $this->jwtRequest(); - }elseif(config('zoom.authentication_method') == 'oauth2'){ - + } elseif (config('zoom.authentication_method') == 'oauth2') { } } - public function jwtRequest() + public function jwtRequest() { $jwtToken = JWT::generateToken(['iss' => config('zoom.api_key'), 'exp' => time() + config('zoom.token_life')], config('zoom.api_secret')); @@ -53,7 +52,5 @@ public function jwtRequest() public function oauth2Request() { - } - } diff --git a/src/Support/Model.php b/src/Support/Model.php index 220dc39..f87c27c 100644 --- a/src/Support/Model.php +++ b/src/Support/Model.php @@ -2,13 +2,11 @@ namespace MacsiDigital\Zoom\Support; -use Illuminate\Support\Str; use MacsiDigital\API\Support\ApiResource; class Model extends ApiResource { - protected $apiDataField = ''; + protected $apiDataField = ''; - protected $dateFormat = \DateTime::ATOM; - -} \ No newline at end of file + protected $dateFormat = \DateTime::ATOM; +} diff --git a/src/Telephony.php b/src/Telephony.php index e230b19..2c23012 100644 --- a/src/Telephony.php +++ b/src/Telephony.php @@ -6,5 +6,4 @@ class Telephony extends Resource { - } diff --git a/src/Token.php b/src/Token.php index 887a1b9..4897f0d 100644 --- a/src/Token.php +++ b/src/Token.php @@ -6,14 +6,14 @@ class Token extends Model { - protected $endPoint = 'users/{user_id}/token'; + protected $endPoint = 'users/{user_id}/token'; protected $allowedMethods = ['get', 'delete']; protected $apiMultipleDataField = 'token'; - public function user() + public function user() { return $this->belongsTo(User::class); } -} \ No newline at end of file +} diff --git a/src/TrackingField.php b/src/TrackingField.php index 776b619..ad6f620 100644 --- a/src/TrackingField.php +++ b/src/TrackingField.php @@ -6,5 +6,4 @@ class TrackingField extends Resource { - } diff --git a/src/TrackingSource.php b/src/TrackingSource.php index 22d5240..9cbdc0e 100644 --- a/src/TrackingSource.php +++ b/src/TrackingSource.php @@ -5,10 +5,10 @@ use MacsiDigital\Zoom\Support\Model; class TrackingSource extends Model -{ +{ protected $endPoint = '/webinars/{webinar:id}/tracking_sources'; protected $allowedMethods = ['get']; protected $apiMultipleDataField = ''; -} \ No newline at end of file +} diff --git a/src/Tsp.php b/src/Tsp.php index 565d245..2cbfc19 100644 --- a/src/Tsp.php +++ b/src/Tsp.php @@ -6,5 +6,4 @@ class Tsp extends Resource { - } diff --git a/src/User.php b/src/User.php index b073cb1..3ccc874 100644 --- a/src/User.php +++ b/src/User.php @@ -2,9 +2,9 @@ namespace MacsiDigital\Zoom; -use MacsiDigital\Zoom\Support\Model; use MacsiDigital\Zoom\Exceptions\FileTooLargeException; use MacsiDigital\Zoom\Exceptions\ValidationException; +use MacsiDigital\Zoom\Support\Model; class User extends Model { @@ -13,7 +13,7 @@ class User extends Model protected $attributes = [ 'action' => 'create', - 'type' => 1 + 'type' => 1, ]; protected $endPoint = 'users'; @@ -27,18 +27,21 @@ class User extends Model public function isBasicType() { $this->type = 1; + return $this; } public function isLicensedType() { $this->type = 2; + return $this; } public function isOnPremType() { $this->type = 3; + return $this; } @@ -99,8 +102,8 @@ public function setOnPrem() public function updateProfilePicture($image) { - $filesize = number_format(filesize($image) / 1048576,2); - if($filesize > 2){ + $filesize = number_format(filesize($image) / 1048576, 2); + if ($filesize > 2) { throw new FileTooLargeException($image, $filesize, '2MB'); } else { return $this->newQuery()->attachFile('pic_file', file_get_contents($image), $image)->sendRequest('post', ['users/'.$this->id.'/picture'])->successful(); @@ -109,7 +112,7 @@ public function updateProfilePicture($image) public function updateStatus($status) { - if(in_array($status, ['activate', 'deactivate'])){ + if (in_array($status, ['activate', 'deactivate'])) { return $this->newQuery()->sendRequest('put', ['users/'.$this->id.'/status', ['action' => $status]])->successful(); } else { throw new ValidationException('Status must be either active or deactivate'); @@ -118,7 +121,7 @@ public function updateStatus($status) public function updatePassword($password) { - if(strlen($password) >= 8){ + if (strlen($password) >= 8) { return $this->newQuery()->sendRequest('put', ['users/'.$this->id.'/password', ['password' => $password]])->successful(); } else { throw new ValidationException('Password must be at least 8 characters'); @@ -128,7 +131,7 @@ public function updatePassword($password) public function updateEmail($email) { $validator = Validator::make(['email' => $email], [ 'email' => 'required|email|max:128' ]); - if($validator->fails()){ + if ($validator->fails()) { throw new ValidationException('Email must be a valid email address less than 128 characters'); } else { return $this->newQuery()->sendRequest('put', ['users/'.$this->id.'/email', ['email' => $email]])->successful(); @@ -144,5 +147,4 @@ public function delete() { return $this->newQuery()->sendRequest('delete', ['users/'.$this->id, ['action' => 'delete']])->successful(); } - } diff --git a/src/Webinar.php b/src/Webinar.php index 461bd89..d7ee1e7 100644 --- a/src/Webinar.php +++ b/src/Webinar.php @@ -13,7 +13,7 @@ class Webinar extends Model protected $customEndPoints = [ 'get' => 'users/{user_id}/webinars', - 'post' => 'users/{user_id}/webinars' + 'post' => 'users/{user_id}/webinars', ]; protected $allowedMethods = ['find', 'get', 'post', 'patch', 'delete']; @@ -24,7 +24,7 @@ class Webinar extends Model protected $dates = [ 'start_time', - 'created_at' + 'created_at', ]; public function settings() @@ -76,5 +76,4 @@ public function endWebinar() { return $this->newQuery()->sendRequest('put', ['webinars/'.$this->id.'/status', ['action' => 'end']])->successful(); } - } diff --git a/src/WebinarOccurrence.php b/src/WebinarOccurrence.php index 4662ad9..632f88c 100644 --- a/src/WebinarOccurrence.php +++ b/src/WebinarOccurrence.php @@ -28,28 +28,30 @@ public function find($id) $occurence = $this->newQuery()->addQuery('occurrence_id', $id)->find($this->webinar_id); $occurence->webinar_id = $this->webinar_id; $occurence->occurrence_id = $id; + return $occurence; } public function getPatchEndPoint() { - if($this->hasCustomEndPoint('patch')){ + if ($this->hasCustomEndPoint('patch')) { return $this->getCustomEndPoint('patch').$this->getKeyForEndPoint(); } + return $this->endPoint.'?occurrence_id='.$this->getKey(); } public function getDeleteEndPoint() { - if($this->hasCustomEndPoint('delete')){ + if ($this->hasCustomEndPoint('delete')) { return $this->getCustomEndPoint('delete').$this->getKeyForEndPoint(); } + return $this->endPoint.'?occurrence_id='.$this->getKey(); } - public function delete($scheduleForReminder=true) + public function delete($scheduleForReminder = true) { return $this->newQuery()->addQuery('schedule_for_reminder', $scheduleForReminder)->delete(); } - } diff --git a/src/WebinarRegistrant.php b/src/WebinarRegistrant.php index 5d50a39..ea676e3 100644 --- a/src/WebinarRegistrant.php +++ b/src/WebinarRegistrant.php @@ -27,21 +27,22 @@ public function customQuestions() public function beforeQuery($query) { - if(isset($this->occurrence_id)){ + if (isset($this->occurrence_id)) { $query->addQuery('occurrence_id', $this->occurrence_id); } } public function beforeInsert($query) { - if(isset($this->occurrence_id)){ + if (isset($this->occurrence_id)) { $query->addQuery('occurrence_id', $this->occurrence_id); } } - protected function updateAction($action){ - if($this->exists()){ - if(isset($this->occurrence_id)){ + protected function updateAction($action) + { + if ($this->exists()) { + if (isset($this->occurrence_id)) { 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(); } else { return $this->newQuery()->sendRequest('put', ['webinars/'.$this->webinar_id.'/registrants/status', ['action' => $action, 'registrants' => [['id' => $this->id, 'email' => $this->email]]]])->successful(); @@ -63,5 +64,4 @@ public function cancel() { return $this->updateAction('cancel'); } - } diff --git a/src/WebinarSetting.php b/src/WebinarSetting.php index 0281e1e..dc61ca6 100644 --- a/src/WebinarSetting.php +++ b/src/WebinarSetting.php @@ -6,10 +6,8 @@ class WebinarSetting extends Resource { - - public function globalDialInCountries() + public function globalDialInCountries() { - return $this->hasMany(GlobalDialInCountry::class); + return $this->hasMany(GlobalDialInCountry::class); } - } diff --git a/tests/Resources/EndPoint.php b/tests/Resources/EndPoint.php index 98331fa..3d62a0a 100644 --- a/tests/Resources/EndPoint.php +++ b/tests/Resources/EndPoint.php @@ -4,56 +4,56 @@ class EndPoint { - protected $apiKey = ''; - protected $apiSecret = ''; - - protected $endPoints = [ - 'methods' => [ - 'find' => [ - - ], - 'get' => [ - - ], - 'post' => [ - - ], - 'put' => [ - - ], - 'patch' => [ - - ], - 'delete' => [ - - ], - ] - ]; - - public function authenticate($token) - { - - } - - public function processEndPoint($method, $endPoint) - { - if($this->hasEndPoint($method, $endPoint)){ - $this->retreiveData($method, $endPoint); - } - } - - public function hasEndPoint() - { - if(isset($this->endPoints[$method]) && isset($this->endPoints[$method][$endPoint])){ - return true; - } - return false; - } - - public function retreieveData($method, $endPoint) - { - $function = $this->endPoints[$method][$endPoint]; - return $this->$function(); - } - -} \ No newline at end of file + protected $apiKey = ''; + protected $apiSecret = ''; + + protected $endPoints = [ + 'methods' => [ + 'find' => [ + + ], + 'get' => [ + + ], + 'post' => [ + + ], + 'put' => [ + + ], + 'patch' => [ + + ], + 'delete' => [ + + ], + ], + ]; + + public function authenticate($token) + { + } + + public function processEndPoint($method, $endPoint) + { + if ($this->hasEndPoint($method, $endPoint)) { + $this->retreiveData($method, $endPoint); + } + } + + public function hasEndPoint() + { + if (isset($this->endPoints[$method]) && isset($this->endPoints[$method][$endPoint])) { + return true; + } + + return false; + } + + public function retreieveData($method, $endPoint) + { + $function = $this->endPoints[$method][$endPoint]; + + return $this->$function(); + } +} diff --git a/tests/Unit/TestCase.php b/tests/Unit/TestCase.php index a4a14ee..acdb1a2 100644 --- a/tests/Unit/TestCase.php +++ b/tests/Unit/TestCase.php @@ -6,7 +6,6 @@ abstract class TestCase extends Orchestra { - public function setUp() : void { parent::setUp(); @@ -33,11 +32,10 @@ protected function getPackageProviders($app) */ protected function setupEnvironment($app) { - if(env('USE_LIVE_API')){ - $app['config']->set('zoom.client_key'); - $app['config']->set('zoom.client_secret'); + if (env('USE_LIVE_API')) { + $app['config']->set('zoom.client_key'); + $app['config']->set('zoom.client_secret'); } else { - } } -} \ No newline at end of file +} diff --git a/tests/Unit/UserTest.php b/tests/Unit/UserTest.php index 58731d2..9d2cd42 100644 --- a/tests/Unit/UserTest.php +++ b/tests/Unit/UserTest.php @@ -4,11 +4,11 @@ class UserTest extends TestCase { - /** @test */ - public function all_users_can_be_listed() - { - $user = Zoom::user()->all(); + /** @test */ + public function all_users_can_be_listed() + { + $user = Zoom::user()->all(); - $this->assertNotNull($user); - } -} \ No newline at end of file + $this->assertNotNull($user); + } +} From dc23b176ab8f418273aa434a6c5c3fd3b49ad27b Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Tue, 8 Sep 2020 16:15:36 +0100 Subject: [PATCH 11/13] Update composer.json --- composer.json | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 48b4793..059a751 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "friendsofphp/php-cs-fixer": "^2.16", "orchestra/testbench": "^4.0|^5.0|^6.0", "phpunit/phpunit": "^8.0|^9.0", - "psalm/plugin-laravel": "^1.2", + "psalm/plugin-laravel": "^1.4", "vimeo/psalm": "^3.11" }, "autoload": { @@ -54,14 +54,5 @@ } }, "minimum-stability" : "dev", - "prefer-stable": true, - "repositories": [ - { - "type": "path", - "url": "../laravel-api-client", - "options": { - "symlink": true - } - } - ] + "prefer-stable": true } From 428c92dcc4fd82beefe2c719812285325605a5e7 Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Tue, 8 Sep 2020 16:43:22 +0100 Subject: [PATCH 12/13] Update Tests --- .github/workflows/run-tests.yml | 4 +--- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 348385e..4f9215f 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -10,15 +10,13 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] php: [7.3, 7.4] - laravel: [6.*, 7.*, 8.*] + laravel: [7.*, 8.*] dependency-version: [prefer-lowest, prefer-stable] include: - laravel: 8.* testbench: 6.* - laravel: 7.* testbench: 5.* - - laravel: 6.* - testbench: 4.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index 059a751..ae84b72 100644 --- a/composer.json +++ b/composer.json @@ -19,8 +19,8 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.16", - "orchestra/testbench": "^4.0|^5.0|^6.0", - "phpunit/phpunit": "^8.0|^9.0", + "orchestra/testbench": "^5.0|^6.0", + "phpunit/phpunit": "^9.0", "psalm/plugin-laravel": "^1.4", "vimeo/psalm": "^3.11" }, From b0af5617a1ad632f13c1a652391abb993606c3fb Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Fri, 11 Sep 2020 10:54:19 +0100 Subject: [PATCH 13/13] Fix typo --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ae84b72..0e942c1 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ ], "require": { "php": "^7.3", - "illuminate/support": "^7.0|^8,0", + "illuminate/support": "^7.0|^8.0", "macsidigital/laravel-api-client": "^3.0" }, "require-dev": {