PHP code example of edzhub / content-sdk-php

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

    

edzhub / content-sdk-php example snippets


use Edzhub\ContentSdk\ContentSdk;

$client = new ContentSdk();

// Set the token if not set in the environment
$client->setToken(env('ZSL_CONTENT_MANAGER_TOKEN'));

// Get Users
$users = $client->getUsers();

// Create a User
$user = $client->createUser(userName: $userName);

// Get Classes
$classes = $client->getClasses();

// Get Subjects
$subjects = $client->getSubjects(class_id: $classId);

// Get Chapters
$chapters = $client->getChapters(class_id: $classId,subject_id: $subjectId);

// Get Topics
$topics = $client->getTopics(chapter_id: $chapterId);

// Get Activities
$activities = $client->getActivities(topic_id: $topicId);

// Get Signed URL for an activity
$signedUrl = $client->getSignedUrl(activity_id: $activityId);

php artisan vendor:publish --provider=Edzhub\ContentSdk\ContentSdkServiceProvider