Skip to content

Commit

Permalink
Rework Based on laravel HTTP Client Instead of the RingCentral SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
yparitcher committed Nov 22, 2024
1 parent 188bfb5 commit 07b7fae
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 212 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RINGCENTRAL_CLIENT_ID=
RINGCENTRAL_CLIENT_SECRET=
RINGCENTRAL_SERVER_URL=
RINGCENTRAL_TOKEN=
RINGCENTRAL_JWT=
#The below are only used for the test suite
RINGCENTRAL_SENDER=
RINGCENTRAL_RECEIVER=
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
RINGCENTRAL_CLIENT_ID: ${{ secrets.RINGCENTRAL_CLIENT_ID }}
RINGCENTRAL_CLIENT_SECRET: ${{ secrets.RINGCENTRAL_CLIENT_SECRET }}
RINGCENTRAL_SERVER_URL: ${{ secrets.RINGCENTRAL_SERVER_URL }}
RINGCENTRAL_TOKEN: ${{ secrets.RINGCENTRAL_TOKEN }}
RINGCENTRAL_JWT: ${{ secrets.RINGCENTRAL_JWT }}
RINGCENTRAL_SENDER: ${{ secrets.RINGCENTRAL_SENDER }}
RINGCENTRAL_RECEIVER: ${{ secrets.RINGCENTRAL_RECEIVER }}
RINGCENTRAL_DELAY_REQUEST_SECONDS: ${{ secrets.RINGCENTRAL_DELAY_REQUEST_SECONDS }}
Expand Down
31 changes: 5 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# A Laravel package for the RingCentral SDK for PHP


This is a simple Laravel Service Provider providing access to the [RingCentral SDK for PHP][client-library].
This is a simple Laravel Service Provider providing access to the RingCentral API.

Forked from [https://github.com/coxlr/laravel-ringcentral](https://github.com/coxlr/laravel-ringcentral), Created by [Lee Cox](https://github.com/coxlr)
With code from: [RingCentral Connect Platform PHP SDK](https://github.com/ringcentral/ringcentral-php)

## Installation

Expand All @@ -12,15 +13,15 @@ This package requires PHP 8.0 and Laravel 8 or higher.
To install the PHP client library using Composer:

```bash
composer require coxlr/laravel-ringcentral
composer require sheavescapital/laravel-ringcentral
```

The package will automatically register the `RingCentral` provider and facade.


You can publish the config file with:
```bash
php artisan vendor:publish --provider="Coxlr\RingCentral\RingCentralServiceProvider" --tag="config"
php artisan vendor:publish --provider="SheavesCapital\RingCentral\RingCentralServiceProvider" --tag="config"
```


Expand All @@ -30,7 +31,7 @@ Then update `config/ringcentral.php` with your credentials. Alternatively, you c
RINGCENTRAL_CLIENT_ID=my_client_id
RINGCENTRAL_CLIENT_SECRET=my_client_secret
RINGCENTRAL_SERVER_URL=my_server_url
RINGCENTRAL_TOKEN=my_jwt
RINGCENTRAL_JWT=my_jwt
```
This package uses the JWT autentication method. You can learn more about setting up JWT for your RingCentral account [here](https://developers.ringcentral.com/guide/authentication/jwt/quick-start).

Expand Down Expand Up @@ -136,28 +137,6 @@ $ringcentral->getMessageAttachmentById(12345678, 910111213, 45678910);



For more information on using the RingCentral client library, see the [official client library repository][client-library].

[client-library]: https://github.com/ringcentral/ringcentral-php


## Testing

``` bash
composer test
```
If using the RingCentral sandbox environment when testing set the following environment variable to true to handle sandbox message prefix.

```dotenv
RINGCENTRAL_IS_SANDBOX=true
```
An optional environment value can be set to prevent hitting RingCentral rate limits when testing. This will add a delay for the set seconds before each test.

```dotenv
RINGCENTRAL_DELAY_REQUEST_SECONDS=20
```


## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
24 changes: 7 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,20 @@
"name": "sheavescapital/laravel-ringcentral",
"description": "A Laravel package for the RingCentral SDK for PHP",
"keywords": [
"coxlr",
"laravel",
"ringcentral"
],
"homepage": "https://github.com/coxlr/laravel-ringcentral",
"homepage": "https://github.com/sheavescapital/laravel-ringcentral",
"license": "MIT",
"authors": [
{
"name": "Lee Cox",
"email": "[email protected]",
"homepage": "https://leecox.dev",
"role": "Developer"
"name": "SheavesCapital"
}
],

"repositories": [
{
"type": "vcs",
"url": "[email protected]:sheavescapital/ringcentral-php"
}
],
"require": {
"php": "^8.0",
"ringcentral/ringcentral-php": "dev-sheaves"
"laravel/framework": "^11.0"
},
"require-dev": {
"laravel/pint": "^1.18",
Expand All @@ -36,12 +26,12 @@
},
"autoload": {
"psr-4": {
"Coxlr\\RingCentral\\": "src"
"SheavesCapital\\RingCentral\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Coxlr\\RingCentral\\Tests\\": "tests"
"SheavesCapital\\RingCentral\\Tests\\": "tests"
}
},
"scripts": {
Expand All @@ -59,10 +49,10 @@
"extra": {
"laravel": {
"providers": [
"Coxlr\\RingCentral\\RingCentralServiceProvider"
"SheavesCapital\\RingCentral\\RingCentralServiceProvider"
],
"aliases": {
"RingCentral": "Coxlr\\RingCentral\\Facades\\RingCentral"
"RingCentral": "SheavesCapital\\RingCentral\\Facades\\RingCentral"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion config/ringcentral.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
'client_id' => function_exists('env') ? env('RINGCENTRAL_CLIENT_ID', '') : '',
'client_secret' => function_exists('env') ? env('RINGCENTRAL_CLIENT_SECRET', '') : '',
'server_url' => function_exists('env') ? env('RINGCENTRAL_SERVER_URL', '') : '',
'token' => function_exists('env') ? env('RINGCENTRAL_TOKEN', '') : '',
'jwt' => function_exists('env') ? env('RINGCENTRAL_JWT', '') : '',
];
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
verbose="true"
>
<testsuites>
<testsuite name="Coxlr Test Suite">
<testsuite name="SheavesCapital Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/CouldNotAuthenticate.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Coxlr\RingCentral\Exceptions;
namespace SheavesCapital\RingCentral\Exceptions;

use Exception;

Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/CouldNotSendMessage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Coxlr\RingCentral\Exceptions;
namespace SheavesCapital\RingCentral\Exceptions;

use Exception;

Expand Down
2 changes: 1 addition & 1 deletion src/Facades/RingCentral.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Coxlr\RingCentral\Facades;
namespace SheavesCapital\RingCentral\Facades;

use Illuminate\Support\Facades\Facade;

Expand Down
Loading

0 comments on commit 07b7fae

Please sign in to comment.