PHP code example of mralston / bark-sdk

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

    

mralston / bark-sdk example snippets



use Mralston\Bark\Client;
use Mralston\Bark\Contact;
use Mralston\Bark\Flow;

// Log in
$client = new Client(
    $client_id,
    $secret,
    $apiEndpoint
);

// Fetch all barks
foreach ($client->listBarks() as $bark) {
    dump($bark);
}

return [
    'client_id' => env('BARK_CLIENT_ID'),
    'secret' => env('BARK_SECRET'),
    'api_endpoint' => env('BARK_API_ENDPOINT'),
];

use Illuminate\Http\Request;
use Mralston\Bark\Client;

class MyController
{
    public function create(Request $request, Client $client)
    {
        // Create new contact using POST data
        $barks = $client->listBarks(),
        )
    }
}

use Mralston\Bark\Client;

$client = app(Client::class);

use Mralston\Bark\Facades\Bark;

$barks = Bark::listBarks();
bash
php artisan vendor:publish --provider="Mralston\Bark\BarkServiceProvider" --tag="config"