PHP code example of kiryi / flaryi

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

    

kiryi / flaryi example snippets


__construct(string $filepath = null)

call(string $endpoint): object

$client = new \Kiryi\Flaryi\Client('configuration/config.ini');
$userList = $client->call('User')->getAll([
    'username',
    'email',
]);

$user = $client->call('User')->get(5);
if (isset($user->data->relationships->groups->data[0]->id)) {
    $client->call('User')->setGroups(5, [2, 3]);
    echo 'User was added to Group 2 and 3.';
} else {
    echo 'User is already in a Group.';
}
ini
[flaryi]
apiUrl = {URLTOYOURFLARUMAPI}
apiKey = {APIKEYFROMYOUFLARUMINSTALLATION}