Skip to content

Commit 08ec050

Browse files
committed
docs: add details
1 parent d7e49e6 commit 08ec050

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# OpenLRW - PHP Api Client
22

3-
> The easier way to implement OpenLRW into your PHP applications
3+
> The easier way to implement OpenLRW into your PHP applications (the documentation is not finished)
4+
5+
This API Client was inspired by the Laravel Framework, it allows you to do HTTP requests to the OpenLRW API but also to manipulate objects from these requests.
46

57
<p align="center">
68
<img src="https://scrutinizer-ci.com/g/Apereo-Learning-Analytics-Initiative/OpenLRW-php-api-client/badges/quality-score.png?b=master" title="Scrutinizer Code Quality">
@@ -9,26 +11,42 @@
911
</p>
1012

1113
## Requirements
12-
14+
- PHP >= 5.6
15+
16+
1317
## Install
1418
`$ composer require openlrw/api-client`
1519

1620

1721
## Usage
1822

19-
#### Initialize the client
23+
### Initialize the client
2024
```php
2125
use OpenLRW\OpenLRW;
2226

2327
$client = new OpenLRW(URL, KEY, PASSWORD);
2428
```
2529

26-
#### Check if the server is up
30+
### Using OneRoster Model
31+
> Example with the User collection
32+
33+
#### Get an entity
2734
```php
35+
$user = User::find('foo-bar');
36+
echo $user->sourcedId; // return 'foo-bar'
37+
```
2838

29-
$isUp = OpeLRW::isUp();
30-
// or
31-
$isUp = $client::isUp();
39+
#### Delete
40+
```php
41+
$user = User::find('foo-bar');
42+
$user->delete(); // User deleted
43+
```
44+
45+
46+
### Helpers
47+
#### Check if the server is up
48+
```php
49+
$isServerUp = OpenLRW::isUp();
3250
```
3351

3452

0 commit comments

Comments
 (0)