PHP code example of a4anthony / whereby-laravel
1. Go to this page and download the library: Download a4anthony/whereby-laravel library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
a4anthony / whereby-laravel example snippets
'providers' => [
...
A4Anthony\WherebyLaravel\Providers\WherebyLaravelServiceProvider::class,
...
]
'aliases' => [
...
'WherebyLaravel': A4Anthony/WherebyLaravel/Facades/WherebyLaravel::class
...
]
return [
/**
* Whereby API Key
*/
"api_key" => env("WHEREBY_API_KEY"),
/**
* Whereby API Version
*/
"api_version" => env("WHEREBY_API_VERSION", "v1"),
/**
* Whereby API Base URL
*/
"base_uri" => env("WHEREBY_BASE_URI", "https://api.whereby.dev"),
];
WHEREBY_API_KEY=xxxxxxxxxxxxx
WHEREBY_API_VERSION=xxxxxxxxxxxxx
WHEREBY_WEBHOOK_SECRET=xxxxxxxxxxxxx
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use WherebyLaravel;
class HomeController extends Controller
{
public function index()
{
$data = [
"isLocked" => false,
"startDate" => "2020-10-10T10:10:10Z",
"endDate" => "2023-10-10T10:10:10Z",
];
$meeting = WherebyLaravel::createMeeting($data); // Create a meeting
dd($meeting);
}
}
/**
* Creates a new meeting
*
* @param array $data [see https://whereby.dev/http-api/#/paths/~1meetings/post]
*/
WherebyLaravel::createMeeting($data);
/**
* Retrieves a meeting
*
* @param string $meetingId [see https://whereby.dev/http-api/#/paths/~1meetings/post]
*/
WherebyLaravel::getMeeting($meetingId);
/**
* Retrieves an event from webhook
*
* [see https://docs.whereby.com/monitoring-usage/webhooks]
*/
WherebyLaravel::webhook();
bash
php artisan vendor:publish --provider="A4Anthony\WherebyLaravel\Providers\WherebyLaravelServiceProvider"