Download the PHP package nikapps/ortc-laravel without Composer

On this page you can find all versions of the php package nikapps/ortc-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ortc-laravel

ORTC-Laravel (ORTC client for Laravel)

Real-time Framework - ORTC

An Easy-To-Use ORTC API Client for Laravel Framework (Laravel 5.1 and 5.2)

If you're using Laravel 4.2.x, please check branch l4

This package is based on nikapps/ortc-php.

Installation

You can install this package by simply run this composer command:

Then, add this service provider in your providers array [app/config/app.php]:

Nikapps\OrtcLaravel\OrtcLaravelServiceProvider::class,

Then, add this Facade to your aliases array [app/config/app.php]:

'Ortc' => Nikapps\OrtcLaravel\Facades\Ortc::class

Next you have to copy the configuration to your connections array [app/config/broadcasting.php]:

'realtime' => [
    'driver' => 'realtime',
    'credentials' => [

        /*
         * your application key
         */
        'application_key' => 'YOUR_APPLICATION_KEY',
        /*
         * your private key
         */
        'private_key'     => 'YOUR_PRIVATE_KEY',

    ],
    /*
    |--------------------------------------------------------------------------
    | Real-time REST API Options
    |--------------------------------------------------------------------------
    | you can change default options of api.
    |
    */
    'api'         => [
        /*
         * send message
         */
        'send_message'   => [
            'path'               => '/send', //api path
            'max_chunk_size'     => 700, //maximum size of each message in bytes
            'batch_pool_size'    => 5, //pool size for concurrent requests
            'pre_message_string' => '{RANDOM}_{PART}-{TOTAL_PARTS}_' //pre message string format
        ],
        /*
         * authentication
         */
        'authentication' => [
            'path' => '/authenticate' //api path
        ],
        /*
         * url to fetch balancer url
         */
        'balancer_url'   => 'https://ortc-developers.realtime.co/server/2.1?appkey={APP_KEY}',
        /*
         * verify ssl/tls certificate
         */
        'verify_ssl'     => true
    ]
]

Configuration

Get Application Key & Private Key

First of all, you should register on realtime.co and get your api keys.

Update config file

Edit app/config/broadcasting.php:

/*
* set default broadcasting driver to realtime
*/
'default' => env('BROADCAST_DRIVER', 'realtime'),

'credentials' => [

    /*
     * your application key
     */
    'application_key' => 'YOUR_APPLICATION_KEY',
    /*
     * your private key
     */
    'private_key'     => 'YOUR_PRIVATE_KEY',

],

Done!

Usage

Get Balancer URL (Manually)

This package automatically get balancer url (best available server), but if you want fetch a new balancer url manually:

$balancerUrl = Ortc::getBalancerUrl();

echo 'Balancer Url: ' . $balancerUrl->getUrl();

Authentication

In order to authenticate a user:

$channels = [
    'channel_one' => 'w',
    'channel_two' => 'r'
];

Ortc::authenticate(
    $authToken, //authentication token
    $channels,
    $ttl, //(optional) default: 3600
    $isPrivate //(optional) default: false
);

Send Message via broadcasting service (recommend) (Push)

See laravel/Events - Marking Events For Broadcast

Below a short example:

Create a new Event

Open up app/Events/TestEvent.php and edit

To fire the event:

$value = 'test 123';
event(new TestEvent($user, $value));

The result will be:

{
    "event": "testEvent",
    "payload": {
        "value": "test 123"
    }
}

Send Message manually (Push)

In order to push a message to a channel:

Ortc::send(
    $channel, //channel name
    $authToken, //authentication token
    $message //message (string)
);

If you are using UTF-8 messages, It's better to use base64_encode().

Exceptions

See nikapps/ortc-php - Exceptions

Dependencies

Ortc Documentation

This package is based on ORTC REST API. You can download REST service documentation from this url:

TODO

Credits

Contribute

Wanna contribute? simply fork this project and make a pull request!

License

This project released under the MIT License.

Donation

Donate via Paypal


All versions of ortc-laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/support Version 5.1.* || 5.2.*
nikapps/ortc-php Version 1.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nikapps/ortc-laravel contains the following files

Loading the files please wait ....