PHP code example of techyscouts / checkfront-sdk

1. Go to this page and download the library: Download techyscouts/checkfront-sdk 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/ */

    

techyscouts / checkfront-sdk example snippets


use TechyScouts\Checkfront\Auth\TokenAuthentication;
use TechyScouts\Checkfront\CheckfrontClient;
use TechyScouts\Checkfront\Configuration;

$config = new Configuration(
    host: 'https://your-company.checkfront.com',
    auth: new TokenAuthentication(apiKey: '...', apiSecret: '...'),
);

$client = new CheckfrontClient($config);

// List bookings
$bookings = $client->bookings()->list();

// Fetch a single booking
$booking = $client->bookings()->fetch('BK-1234');

// List products
$products = $client->products()->list();

use TechyScouts\Checkfront\Auth\OAuth2Authentication;

$auth = new OAuth2Authentication(accessToken: '...');
bash
php artisan vendor:publish --provider="TechyScouts\Checkfront\Laravel\CheckfrontServiceProvider"