PHPackages                             smtech/canvaspest - 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. [API Development](/categories/api)
4. /
5. smtech/canvaspest

AbandonedArchivedLibrary[API Development](/categories/api)

smtech/canvaspest
=================

An extension of Pest to make RESTful queries to the Instructure Canvas API

v1.1.9(8y ago)25.0k↓50%2[3 issues](https://github.com/smtech/canvaspest/issues)3LGPL-3.0PHP

Since Jun 30Pushed 8y ago4 watchersCompare

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

READMEChangelog (10)Dependencies (2)Versions (15)Used By (3)

CanvasPest
==========

[](#canvaspest)

[![Latest Version](https://camo.githubusercontent.com/66f79a1c6a5a90620de0271903f89b2d979ba4f3f105edd591cb78b0a16c7e01/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736d746563682f63616e766173706573742e737667)](https://packagist.org/packages/smtech/canvaspest)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/3609404ecc4e44a7e8019b5901b2fd383c245d6cdbf49242d28140fbfbbc6dfe/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736d746563682f63616e766173706573742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/smtech/canvaspest/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/05125a1dc553c754f78bf4e4525262b15f45f7cb3f25cc278118d8a552147183/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736d746563682f63616e766173706573742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/smtech/canvaspest/?branch=master)[![Build Status](https://camo.githubusercontent.com/29654cfb299ec21abad76ba1eef860736c28fff3e19a69da44dbe1dda0c5a392/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736d746563682f63616e766173706573742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/smtech/canvaspest/build-status/master)

Object-oriented access to the Canvas API using PHP.

Install
-------

[](#install)

In your `composer.json`, include:

```
"require": {
	"smtech/canvaspest": "1.*"
}
```

Use
---

[](#use)

### CanvasPest

[](#canvaspest-1)

Create a new CanvasPest to make RESTful queries to the Canvas API:

```
// construct with the API URL and an API access token
$api = new CanvasPest('https://canvas.instructure.com/api/v1', 'df2bcbad95f606d6e80093f8e40c4e5ca171d8c5e4f2138e1d58273e33b262ef')

```

Make a RESTful query to the API:

```
// GET, PUT, POST, DELETE are all supported
$obj = $api->get('users/self/profile');
```

The response from a query is either a `CanvasObject` or a `CanvasArray` (of CanvasObjects, natch), depending on whether you requested a specific object or a list of objects (even if the list turns out to be a single object).

### CanvasObjects

[](#canvasobjects)

CanvasObject fields can be accessed either object-style or array style:

```
$obj = $api->get('courses/123');
echo $obj['sis_course_id']; // array-style
echo $obj->title; // object-style
```

### CanvasArrays

[](#canvasarrays)

CanvasArrays can be iterated conveniently using the `foreach` control structure.

```
$arr = $api->get('/accounts/1/users');
foreach($arr as $obj) {
	echo $obj->name;
}
```

One could also access arbitrary elements of the CanvasArray:

```
$arr = $api->get('accounts/1/courses');
echo $arr[1337]->title;
```

Note that both CanvasObjects and CanvasArrays are immutable objects -- that is, they are treated as read-only. In fact, if you attempt to alter a CanvasObject or a CanvasArray, exceptions will be thrown.

[Full API documentation](http://smtech.github.io/canvaspest/namespaces/smtech.CanvasPest.html) is available in the repository.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~59 days

Recently: every ~78 days

Total

13

Last Release

3261d ago

Major Versions

v0.9 → v1.02015-07-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/d0554a28104c65004c6de4d335ada25cf2763c8a9691dc5611314486d461fa4c?d=identicon)[battis](/maintainers/battis)

---

Top Contributors

[![battis](https://avatars.githubusercontent.com/u/419619?v=4)](https://github.com/battis "battis (4 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/smtech-canvaspest/health.svg)

```
[![Health](https://phpackages.com/badges/smtech-canvaspest/health.svg)](https://phpackages.com/packages/smtech-canvaspest)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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