katsana/silverstreet

Silverstreet API Client for PHP
17,236 7
Install
composer require katsana/silverstreet
Latest Version:v3.2.1
PHP:^7.2 || ^8.0
License:BSD-3-Clause
Last Updated:Oct 23, 2024
Links: GitHub  ·  Packagist
Maintainer: crynobone

Silverstreet API Client for PHP

tests Latest Stable Version Total Downloads Latest Unstable Version License

Installation

To install through composer, simply put the following in your composer.json file:

{
    "require": {
        "katsana/silverstreet": "^3.0",
        "php-http/guzzle6-adapter": "^2.0"
    }
}

HTTP Adapter

Instead of utilizing php-http/guzzle6-adapter you might want to use any other adapter that implements php-http/client-implementation. Check Clients & Adapters for PHP-HTTP.

Usages

Creating Silverstreet Client

You can start by creating a client by using the following code (which uses php-http/guzzle6-adapter):

<?php

use Silverstreet\Client;

$http = Laravie\Codex\Discovery::client();


$silverstreet = new Client($http, 'your-api-username', 'your-api-password');

You could also use php-http/discovery to automatically pick available adapter installed via composer:

<?php

use Silverstreet\Client;

$silverstreet = Client::make('your-api-username', 'your-api-password');

Sending Text Messages

You can send text messages by running the following code.

$silverstreet->uses('Message')
    ->text('Hello world', '+60123456789', $sender);

Checking Credit Balance

You can request for available balance by running the following code.

$balance = $silverstreet->uses('Credit')->available();

echo $balance; // 400

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

584,532,650 34,931
laravel/tinker

Powerful REPL for the Laravel framework.

493,838,477 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

408,553,772 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

391,429,217 4,660