PHPackages                             wondeltd/php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. wondeltd/php-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

wondeltd/php-client
===================

PHP Client for Wonde

3.1.4(1y ago)24456.6k↓18.4%31[2 PRs](https://github.com/wondeltd/php-client/pulls)2MITPHPPHP ^7.2.5 || ^8.0

Since Jun 22Pushed 1mo ago20 watchersCompare

[ Source](https://github.com/wondeltd/php-client)[ Packagist](https://packagist.org/packages/wondeltd/php-client)[ RSS](/packages/wondeltd-php-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (27)Used By (2)

Wonde PHP Client
================

[](#wonde-php-client)

Documentation

Installation
------------

[](#installation)

Requires PHP 7.2.5+ (including PHP 8.0)

Using Composer:

```
{
  "require": {
    "wondeltd/php-client": "3.*"
  }
}
```

or

```
composer require wondeltd/php-client
```

Early Release
-------------

[](#early-release)

If you wish to get early access to new endpoints / improvements please set your package version to `dev-master`.

**Important Note:** Wonde strongly recommends locking to a stable version on production.

Endpoints
---------

[](#endpoints)

### Client

[](#client)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');
```

### Schools

[](#schools)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

// Loop through the schools your account has access to
foreach ($client->schools->all() as $school) {
    // Display school name
    echo $school->name . PHP_EOL;
}
```

### Single School

[](#single-school)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

// Get single school
$school = $client->schools->get('SCHOOL_ID_GOES_HERE');
```

### Pending Schools

[](#pending-schools)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

foreach ($client->schools->pending() as $school) {
    // Display school name
    echo $school->name . PHP_EOL;
}
```

### Search Schools

[](#search-schools)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

// Search for schools with a postcode starting CB21
foreach ($client->schools->search([], ['postcode' => 'CB21']) as $school) {
    // Display school name
    echo $school->name . PHP_EOL;
}

// Search for schools with the establishment number = 6006
foreach ($client->schools->search([], ['establishment_number' => '6006']) as $school) {
    // Display school name
    echo $school->name . PHP_EOL;
}
```

### Request Access

[](#request-access)

Provide the school ID to request access to a school's data.

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$client->requestAccess('A0000000000');
```

### Revoke Access

[](#revoke-access)

Provide the school ID to access already approve or pending approval.

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$client->revokeAccess('A0000000000');
```

### Students

[](#students)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get students
foreach ($school->students->all() as $student) {
    echo $student->forename . ' ' . $student->surname . PHP_EOL;
}

// Get single student
$student = $school->students->get('STUDENT_ID_GOES_HERE');

// Get students and include contact_details object
foreach ($school->students->all(['contact_details']) as $student) {
    echo $student->forename . ' ' . $student->surname . PHP_EOL;
}

// Get students and include contacts array
foreach ($school->students->all(['contacts']) as $student) {
    echo $student->forename . ' ' . $student->surname . PHP_EOL;
}

// Get students, include contact_details object, include extended_details object and filter by updated after date
foreach ($school->students->all(['contact_details', 'extended_details'], ['updated_after' => '2016-06-24 00:00:00']) as $student) {
    echo $student->forename . ' ' . $student->surname . PHP_EOL;
}
```

### Pre Admission Students

[](#pre-admission-students)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get students
foreach ($school->studentsPreAdmission->all() as $studentPreAdmission) {
    echo $studentPreAdmission->forename . ' ' . $studentPreAdmission->surname . PHP_EOL;
}

// Get single student
$student = $school->studentsPreAdmission->get('STUDENT_ID_GOES_HERE');
```

### Achievements

[](#achievements)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get achievements
foreach ($school->achievements->all() as $achievement) {
    echo $achievement->comment . PHP_EOL;
}
```

### POST Achievements

[](#post-achievements)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');

$array = [
    'students'      => [
        [
            'student_id' => 'A1039521228',
            'points'     => 200,
            'award'      => 'TROP',
            'award_date' => '2016-04-05',
        ],
    ],
    'employee_id'   => 'A1375078684',
    'date'          => '2016-04-04',
    'type'          => 'NYPA',
    'comment'       => 'A4',
    'activity_type' => 'RE',
];

try {
    $response = $school->achievements->create($array);
} catch (\Wonde\Exceptions\ValidationError $error) {
    $errors = $error->getErrors();
}
```

### DELETE Achievements

[](#delete-achievements)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

$school->achievements->delete('WONDE_ACHIEVEMENTS_ID_HERE');
```

### Achievements Attributes

[](#achievements-attributes)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get achievement attributes
foreach ($school->achievementsAttributes->all() as $achievement) {
    echo $achievement->id . PHP_EOL;
}
```

### Assessment - (BETA)

[](#assessment---beta)

This endpoint is included in the stable release but is likely to change in the future. Please contact support for more information.

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get aspects
foreach ($school->assessment->aspects->all() as $aspect) {
    echo $aspect->id . PHP_EOL;
}

// Get templates
foreach ($school->assessment->templates->all() as $templates) {
    echo $templates->id . PHP_EOL;
}

// Get result sets
foreach ($school->assessment->templates->all() as $resultsets) {
    echo $resultsets->id . PHP_EOL;
}

// Get results
foreach ($school->assessment->results->all() as $results) {
    echo $results->id . PHP_EOL;
}

// Get marksheets
foreach ($school->assessment->marksheets->all() as $marksheets) {
    echo $marksheets->id . PHP_EOL;
}
```

### Attendance

[](#attendance)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get attendance
foreach ($school->attendance->all() as $attendance) {
    echo $attendance->comment . PHP_EOL;
}
```

### POST Attendance

[](#post-attendance)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

// Initiate a new register
$register = new \Wonde\Writeback\SessionRegister();

// Initiate a new attendance record
$attendance = new \Wonde\Writeback\SessionAttendanceRecord();

// Set fields
$attendance->setStudentId('STUDENT_ID_GOES_HERE');
$attendance->setDate('2017-01-01');
$attendance->setSession('AM'); // AM or PM
$attendance->setAttendanceCodeId('ATTENDANCE_CODE_ID_GOES_HERE');
$attendance->setComment('Comment here.');
$attendance->setMinutesLate(10);

// Add attendance mark to register
$register->add($attendance);

// Save the session register
$result = $school->attendance()->sessionRegister($register);

// Writeback id is part of the response
echo $result->writeback_id;
```

### Attendance Codes

[](#attendance-codes)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

// Get attendance codes
foreach ($client->attendanceCodes->all() as $attendanceCode) {
    echo $attendanceCode->code . PHP_EOL;
}

// Get school attendance codes
$school = $client->school('SCHOOL_ID_GOES_HERE');
foreach ($school->attendanceCodes->all() as $attendanceCode) {
    echo $attendanceCode->code . PHP_EOL;
}
```

### Attendance Summaries

[](#attendance-summaries)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get attendance summaries
foreach ($school->attendanceSummaries->all() as $attendanceSummary) {
    echo $attendance->possible_marks . PHP_EOL;
}
```

### Behaviours

[](#behaviours)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get behaviours
foreach ($school->behaviours->all() as $behaviour) {
    echo $behaviour->incident . PHP_EOL;
}
```

### POST Behaviours

[](#post-behaviours)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');
$school = $client->school('SCHOOL_ID_GOES_HERE');

$array = [
    'students'      => [
        [
            'student_id'  => 'A1039521228',
            'role'        => 'AG',
            'action'      => 'COOL',
            'action_date' => '2016-04-01',
            'points'      => 200,
        ],
        [
            'student_id' => 'A870869351',
            'role'       => 'TA',
            'points'     => 2,
        ],
    ],
    'employee_id'   => 'A1375078684',
    'date'          => '2016-03-31',
    'status'        => 'REV2',
    'type'          => 'BULL',
    'bullying_type' => 'B_INT',
    'comment'       => 'Bulling incident',
    'activity_type' => 'RE',
    'location'      => 'CORR',
    'time'          => 'LUN',
];

try {
    $response = $school->behaviours->create($array);
} catch (\Wonde\Exceptions\ValidationError $error) {
    $errors = $error->getErrors();
}
```

### DELETE Behaviours

[](#delete-behaviours)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

$school->behaviours->delete('WONDE_BEHAVIOUR_ID_HERE');
```

### Behaviours Attributes

[](#behaviours-attributes)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get behaviours
foreach ($school->behavioursAttributes->all() as $behaviour) {
    echo $behaviour->id . PHP_EOL;
}
```

### Classes

[](#classes)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get classes
foreach ($school->classes->all() as $class) {
    echo $class->name . PHP_EOL;
}
```

### Contacts

[](#contacts)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get contacts
foreach ($school->contacts->all() as $contacts) {
    echo $contacts->forename . ' ' . $contacts->surname . PHP_EOL;
}
```

### Counts

[](#counts)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get counts
$counts = $school->counts->all(['students','contacts']);
echo $counts->array->students->data->count . PHP_EOL;
echo $counts->array->contacts->data->count . PHP_EOL;
```

### Deletions

[](#deletions)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get deletions
foreach ($school->deletions->all() as $deletions) {
    echo $deletions->id;
}
```

### Employees

[](#employees)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get employees
foreach ($school->employees->all() as $employee) {
    echo $employee->forename . ' ' . $employee->surname . PHP_EOL;
}
```

### Employee Absences

[](#employee-absences)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get employee absences
foreach ($school->employeeAbsences->all() as $employeeAbsence) {
    echo $employeeAbsence->employee . ' ' . $employeeAbsence->absence_type . PHP_EOL;
}
```

### Events

[](#events)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get events
foreach ($school->events->all() as $event) {
    echo $event->id . PHP_EOL;
}
```

### Groups

[](#groups)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get groups
foreach ($school->groups->all() as $group) {
    echo $group->name . PHP_EOL;
}
```

### Lessons

[](#lessons)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get lessons
foreach ($school->lessons->all() as $lesson) {
    echo $lesson->period_id . '-' . $lesson->class_id . PHP_EOL;
}
```

### Lesson Attendance

[](#lesson-attendance)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get lesson attendance
foreach ($school->lessonAttendance->all() as $lessonAttendance) {
    echo $lessonAttendance->comment . PHP_EOL;
}
```

### POST Lesson Attendance

[](#post-lesson-attendance)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

// Initiate a new register
$register = new \Wonde\Writeback\LessonRegister();

// Initiate a new attendance record
$attendance = new \Wonde\Writeback\LessonAttendanceRecord();

// Set fields
$attendance->setStudentId('STUDENT_ID_GOES_HERE');
$attendance->setLessonId('LESSON_ID_GOES_HERE');
$attendance->setAttendanceCodeId('ATTENDANCE_CODE_ID_GOES_HERE');

// Add attendance mark to register
$register->add($attendance);

// Save the lesson register
$result = $school->lessonAttendance()->lessonRegister($register);

// Writeback id is part of the response
echo $result->writeback_id;
```

### Medical Conditions

[](#medical-conditions)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get medical conditions
foreach ($school->medicalConditions->all() as $medicalCondition) {
    echo $medicalCondition->description . PHP_EOL;
}
```

### Medical Events

[](#medical-events)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get medical events
foreach ($school->medicalEvents->all() as $medicalEvent) {
    echo $medicalEvent->description . PHP_EOL;
}
```

### Doctors

[](#doctors)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get doctors
foreach ($school->doctors->all() as $doctor) {
    echo $doctor->surname . PHP_EOL;
    echo $doctor->practice_name . PHP_EOL;
    echo $doctor->telephone . PHP_EOL;
}
```

### Periods

[](#periods)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get periods
foreach ($school->periods->all() as $period) {
    echo $period->name . PHP_EOL;
}
```

### Photos

[](#photos)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get photos
foreach ($school->photos->all() as $photo) {
    echo $photo->hash . PHP_EOL;
}
```

### Rooms

[](#rooms)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get rooms
foreach ($school->rooms->all() as $room) {
    echo $room->name . PHP_EOL;
}
```

### Subjects

[](#subjects)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$school = $client->school('SCHOOL_ID_GOES_HERE');

// Get subjects
foreach ($school->subjects->all() as $subject) {
    echo $subject->name . PHP_EOL;
}
```

### Meta

[](#meta)

```
$client = new \Wonde\Client('TOKEN_GOES_HERE');

$metaObject = $client->meta->get('SCHOOL_ID_GOES_HERE');
```

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance64

Regular maintenance activity

Popularity49

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 54.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~131 days

Recently: every ~204 days

Total

23

Last Release

728d ago

Major Versions

1.5.0 → 2.0.02018-10-24

2.1.2 → 3.0.02021-10-07

2.2.2 → 3.1.02022-02-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/03cd71911f78057bb3b90834b10516ab7dfcfff68a64f055a07851b62a66ebe9?d=identicon)[pclifton-wonde](/maintainers/pclifton-wonde)

---

Top Contributors

[![philipmclifton](https://avatars.githubusercontent.com/u/3420435?v=4)](https://github.com/philipmclifton "philipmclifton (39 commits)")[![Hodglim](https://avatars.githubusercontent.com/u/893162?v=4)](https://github.com/Hodglim "Hodglim (11 commits)")[![fretwellian](https://avatars.githubusercontent.com/u/958657?v=4)](https://github.com/fretwellian "fretwellian (3 commits)")[![jamesdb](https://avatars.githubusercontent.com/u/6299056?v=4)](https://github.com/jamesdb "jamesdb (2 commits)")[![ptmcnally](https://avatars.githubusercontent.com/u/30559829?v=4)](https://github.com/ptmcnally "ptmcnally (2 commits)")[![JRHodgesWonde](https://avatars.githubusercontent.com/u/86420056?v=4)](https://github.com/JRHodgesWonde "JRHodgesWonde (2 commits)")[![martinbean](https://avatars.githubusercontent.com/u/167312?v=4)](https://github.com/martinbean "martinbean (1 commits)")[![nickspringham](https://avatars.githubusercontent.com/u/45168010?v=4)](https://github.com/nickspringham "nickspringham (1 commits)")[![paulskinnerlibris](https://avatars.githubusercontent.com/u/673204?v=4)](https://github.com/paulskinnerlibris "paulskinnerlibris (1 commits)")[![qasimasghar](https://avatars.githubusercontent.com/u/4421170?v=4)](https://github.com/qasimasghar "qasimasghar (1 commits)")[![RichardStyles](https://avatars.githubusercontent.com/u/1642215?v=4)](https://github.com/RichardStyles "RichardStyles (1 commits)")[![benlumley](https://avatars.githubusercontent.com/u/194052?v=4)](https://github.com/benlumley "benlumley (1 commits)")[![yal-baldawi](https://avatars.githubusercontent.com/u/143717824?v=4)](https://github.com/yal-baldawi "yal-baldawi (1 commits)")[![bluesky-ben](https://avatars.githubusercontent.com/u/60763747?v=4)](https://github.com/bluesky-ben "bluesky-ben (1 commits)")[![calfc](https://avatars.githubusercontent.com/u/133207306?v=4)](https://github.com/calfc "calfc (1 commits)")[![cdplant](https://avatars.githubusercontent.com/u/77061160?v=4)](https://github.com/cdplant "cdplant (1 commits)")[![dwalker109](https://avatars.githubusercontent.com/u/4749645?v=4)](https://github.com/dwalker109 "dwalker109 (1 commits)")[![HughNobleWonde](https://avatars.githubusercontent.com/u/105650065?v=4)](https://github.com/HughNobleWonde "HughNobleWonde (1 commits)")

---

Tags

wonde

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wondeltd-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/wondeltd-php-client/health.svg)](https://phpackages.com/packages/wondeltd-php-client)
```

###  Alternatives

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
