Download the PHP package findbrok/php-watson-api-bridge without Composer
On this page you can find all versions of the php package findbrok/php-watson-api-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-watson-api-bridge
PHP IBM Watson API Bridge
Introduction
PHP IBM Watson API Bridge, provides a simple and easy to use wrapper around the IBM Watson API. The library makes it easier for us to develop PHP apps that use the IBM Watson API.
License
PHP IBM Watson API Bridge is open-sourced software licensed under the MIT license
Installation
Usage
Before using the package checkout Watson API Explorer, to get a sense of what you can and cannot do with Watson
The Package uses Guzzle to perform requests, all your responses will be instances of
Integration with Laravel 5
As of version 1.1.x, PHP Watson API bridge adds a new Service Provider which integrates easily with Laravel 5.
If you are using Laravel >= 5.5, you can skip service registration and aliases registration thanks to Laravel auto package discovery feature.
First add the ServiceProvider to your file:
You can also add the following aliases to you file:
Now publish the config file:
You will now have a config file in your config directory. You may define in this config file your credentials, auth method to use, Watson Services and so on.
Services
The Laravel Integration gives you 3 service classes that are bound to the IoC.
- FindBrok\WatsonBridge\Bridge (The actual Bridge class for making requests to Watson)
- FindBrok\WatsonBridge\Support\Carpenter (Which can construct Bridge instances using your credentials and service URL)
- FindBrok\WatsonBridge\Support\BridgeStack (Essentially a store where you can keep all Bridges you constructed and retrieve them back.)
Bridge
class will help you make requests to Watson API using the , , , methods:
Carpenter
The class can build any type of Bridge for you. Use the method passing in the desired parameters like credentials name, service to use and auth method and so on and the will.
Remember that your credentials names, services and auth methods are all defined in the config file.
BridgeStack
The is a great place to keep all your Bridges so that you can retrieve them anytime in your app. Use the method to construct and keep any type of Bridge in the Stack.
The is essentially a Laravel Collection, thus you have access to all Collection methods.
Facades
If you are using Laravel version less than 5.4 you have access to 3 Facades for the 3 services Bridge, Carpenter and BridgeStack. Since Laravel 5.4 added automatic Facades you won't be needing those classes.
- FindBrok\WatsonBridge\Facades\Bridge
- FindBrok\WatsonBridge\Facades\BridgeStack
- FindBrok\WatsonBridge\Facades\Carpenter
Remember that if you are resolving the Bridge directly from the IoC and not constructing it with the Carpenter class a default Bridge will be resolved for you using the default credentials and auth methods from your watson-bridge config.
Credits
Big Thanks to all developers who worked hard to create something amazing!
Creator
Twitter: @PercyMamedy
GitHub: percymamedy
All versions of php-watson-api-bridge with dependencies
guzzlehttp/guzzle Version 6.2.*
illuminate/support Version ~5.0
nesbot/carbon Version ~1.20