Property | Type | Description | |
---|---|---|---|
$client | GuzzleHttp\ClientInterface | ||
$config | Holds the current config instance. | ||
$endpoint | API endpoint | ||
$source | source language | ||
$target | target language |
Method | Description | |
---|---|---|
__construct ( Illuminate\Contracts\Foundation\Application $app, GuzzleHttp\ClientInterface $client ) | ||
setSource ( $source = null ) | ||
setTarget ( $target ) | ||
translate ( $text ) : string |
Method | Description | |
---|---|---|
getApiKey ( ) : string | Returns the api key from the configuration. | |
getSource ( ) : string | Returns the source language. | |
getTarget ( ) : string | Returns the target language. | |
parseResponse ( array $contents ) : mixed | Extract and decode the translation response. |
public __construct ( Illuminate\Contracts\Foundation\Application $app, GuzzleHttp\ClientInterface $client ) | ||
$app | Illuminate\Contracts\Foundation\Application | |
$client | GuzzleHttp\ClientInterface |
protected parseResponse ( array $contents ) : mixed | ||
$contents | array | |
return | mixed |
protected ClientInterface,GuzzleHttp $client | ||
return | GuzzleHttp\ClientInterface |