1. Go to this page and download the library: Download qurban-ali/pescheck-wrapper 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/ */
qurban-ali / pescheck-wrapper example snippets
use QurbanAli\PescheckWrapper\Client;
// Basic initialization with default environment (staging)
$client = new Client([
'email' => 'your-email',
'password' => 'your-password',
]);
// Initialize with a specific environment
$client = new Client([
'email' => 'your-email',
'password' => 'your-password',
'environment' => 'production', // Options: 'production', 'staging', 'testing', 'development'
]);
// Or specify a custom base URI
$client = new Client([
'email' => 'your-email',
'password' => 'your-password',
'base_uri' => 'https://your-custom-api-endpoint.com/api'
]);
// Switch to production
$client->getConfig()->setEnvironment('production');
// Switch to testing
$client->getConfig()->setEnvironment('testing');
// Get available environments
$environments = $client->getConfig()->getAvailableEnvironments();
// Returns: ['production', 'staging', 'testing', 'development']
// Add a custom environment
$client->getConfig()->addEnvironment('local', 'http://localhost:8000/api');
$client->getConfig()->setEnvironment('local');
// Login to get access token (automatically stored in the client)
$authResponse = $client->auth()->login();
// If you need to refresh the token
$refreshResponse = $client->auth()->refresh();
// Get all available packages
$packages = $client->packages()->all();
// Get a specific package
$package = $client->packages()->get('package-id');
// Create a new screening
$screening = $client->screenings()->create([
'email' => '[email protected]',
'first_name' => 'John',
'last_name' => 'Doe',
'package_id' => 'package-uuid'
]);
// Get all screenings (with optional filters)
$allScreenings = $client->screenings()->all([
'status' => 'completed',
'page' => 1
]);
// Get a specific screening
$screening = $client->screenings()->get('screening-id');
// Get documents for a screening
$documents = $client->screenings()->getDocuments('screening-id');
// Get all divisions
$divisions = $client->divisions()->all();
// Get all available checks
$checks = $client->checks()->all();
// Paginated responses implement IteratorAggregate and Countable
$screenings = $client->screenings()->all();
// Get total count
$total = $screenings->getCount();
// Iterate through results
foreach ($screenings as $screening) {
echo $screening['id'] . "\n";
}
// Get all results as array
$results = $screenings->getResults();
// Check if there are more pages
$nextPageUrl = $screenings->getNext();
$previousPageUrl = $screenings->getPrevious();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.