PHP code example of bgsu-lits / libcal

1. Go to this page and download the library: Download bgsu-lits/libcal 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/ */

    

bgsu-lits / libcal example snippets



ent = new \Lits\LibCal\Client(
    'bgsu.libcal.com',
    '100',
    '61483dcf150d97c921abbe1f8024eb2e',
    new GuzzleHttp\Client(),           // Psr\Http\Client\ClientInterface
    new GuzzleHttp\Psr7\HttpFactory(), // Psr\Http\Message\RequestFactoryInterface
    new GuzzleHttp\Psr7\HttpFactory(), // Psr\Http\Message\StreamFactoryInterface
    new Desarrolla2\Cache\Memory()     // Psr\SimpleCache\CacheInterface
);

$locations = $client->space()->locations()->send();

$locations = $client->space()->locations()
    ->setDetails()
    ->setAdminOnly()
    ->send();

$item = $client->space()->item(100)->send();

$_POST = [
    'start' => '2021-12-31T10:00:00-0400',
    'fname' => 'Freddie',
    'lname' => 'Falcon',
    'email' => '[email protected]',
    'bookings' => [
        [
            'id' => 100,
            'to' => '2021-12-31T11:00:00-0400',
        ],
    ],
];

$data = new \Lits\LibCal\Data\Space\Reserve\PayloadReserveSpaceData
    ::fromArray($_POST);

$response = $client->space()->reserve($data)->send();

$locations = $client->space()->locations()->cache()->send();

php composer.phar