PHP code example of kokiddp / phptela

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

    

kokiddp / phptela example snippets


use KokiDDP\PHPTela\TelaClient;

$client = new TelaClient();

$activityId = 'your_activity_id';
$response = $client->getActivity($activityId);
$activity = $response->get();
echo $activity->title;

$response = $client->getAllActivities();
$activities = $response->get();
foreach ($activities as $activity) {
    echo $activity->title;
}

$response = $client->getAllActivities();
$activities = $response->filterByTitle('something')->get();
$activities = $response->filterByType('Museo')->get();
$activities = $response->search('keyword')->get();
$activities = $response->filterByCreator('someCreatorId')->get();
$activities = $response->filterByCity('Lucca')->get();
$activities = $response->filterByDates(new DateTimeImmutable('now'), new DateTimeImmutable('next month'))->get();
$activities = $response->orderByStartDate()->get();

$response = $client->getAllActivities();
$activities = $response
    ->filterByType('Evento')
    ->filterByCity('Lucca')
    ->filterByDates(new DateTimeImmutable('now'), new DateTimeImmutable('next month'))
    ->orderByStartDate()
    ->get();

$response = $client->getAllActivities();
$activities = $response
    ->where(fn(Activity $activity) => $activity->isOpen)
    ->get();

$response = $client->login('[email protected]', 'password');
$user = $response->get();