PHP code example of programic / laravel-kenniss

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

    

programic / laravel-kenniss example snippets


'kenniss' => [
    'baseUrl' => env('KENNISS_BASE_URL'),
    'apiKey' => env('KENNISS_API_TOKEN'),
],

$kenniss = app(Programic\Kenniss\Kenniss::class);

use Programic\Kenniss\Kenniss;

class UserController extends Controller {
    public function __invoke(Kenniss $client)
    {
        //
    }
}

$kenniss->get('/users');
$kenniss->post('/users', []);
$kenniss->patch('/users/1', []);
$kenniss->delete('/users/1', []);

$user = $kenniss->users()->find(1);
$user = $kenniss->users()->create([]);
$user = $kenniss->users()->update(1, []);
$user = $kenniss->users()->delete(1);