PHPackages                             oytunistrator/google-translate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. oytunistrator/google-translate

AbandonedArchivedLibrary

oytunistrator/google-translate
==============================

Free Laravel package for Google Translate REST API with your own API key

1.0(4y ago)08MITPHPPHP &gt;=5.5.9

Since May 20Pushed 4y agoCompare

[ Source](https://github.com/oytunistrator/google-translate)[ Packagist](https://packagist.org/packages/oytunistrator/google-translate)[ Docs](https://github.com/oytunistrator/google-translate)[ RSS](/packages/oytunistrator-google-translate/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Laravel package for Google Translate REST API
=============================================

[](#laravel-package-for-google-translate-rest-api)

Package allows to work with [Google Translate API](https://cloud.google.com/translate/)

Installation
------------

[](#installation)

Package can be installed using composer by adding to "require" object

```
"require": {
    "oytunistrator/google-translate"
}

```

or from console:

```
composer require oytunistrator/google-translate

```

Configuration
-------------

[](#configuration)

After the installation, you should add "Dedicated\\GoogleTranslate\\GoogleTranslateProvider" to providers.

```
        'providers' => [
                /* 3rd Party Providers */
                TranslatorFarm\GoogleTranslateProvider::class,
         ],

```

Then you should publish config file to be able to add your Google API key. To publish config you should do:

```
php artisan vendor:publish \
--provider="TranslatorFarm\GoogleTranslateProvider" --tag=config

```

After config is published, you will have it in `config\google-translate.php` of your Laravel project directory

You should change only one line:

```
    ...

    /**
     * Google key for authentication
     */
    'api_key' => 'YOUR-GOOGLE-API-KEY-GOES-HERE',

    ...

```

Usage
-----

[](#usage)

To translate text with given source language and target language:

```
$translator = new TranslatorFarm\Translator;

$result = $translator->setSourceLang('en')
                     ->setTargetLang('ru')
                     ->translate('Hello World');

dd($result); // "Привет мир"

```

To translate html content with given source language and target language:

```
$translator = new TranslatorFarm\HtmlTranslate;

$result = $translator->setSourceLang('en')
                     ->setTargetLang('ru')
                     ->htmlTranslate('Hello World');

dd($result); // "Привет мир"

```

By default language detection is turned on, so you can translate text without specifying source language.

This will make 2 requests to google API:

- First request will go to /detect URL and get source language name
- Second request will make actual translate request and give out result.

```
$translator = new TranslatorFarm\Translator;

$result = $translator->setTargetLang('ru')
                     ->translate('Hello World');

dd($result); // "Привет мир"

```

You can also use function to only detect text's source language:

```

$result = $translator->detect('Hello World');

dd($result); // "en"

```

### License

[](#license)

This repository code is open-sourced software licensed under the MIT license.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1823d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/82250071?v=4)[czsr](/maintainers/czsr)[@czsr](https://github.com/czsr)

---

Top Contributors

[![oytunistrator](https://avatars.githubusercontent.com/u/3594944?v=4)](https://github.com/oytunistrator "oytunistrator (12 commits)")[![aurawindsurfing](https://avatars.githubusercontent.com/u/14302496?v=4)](https://github.com/aurawindsurfing "aurawindsurfing (10 commits)")[![ddctd143](https://avatars.githubusercontent.com/u/46392057?v=4)](https://github.com/ddctd143 "ddctd143 (10 commits)")[![draaslan](https://avatars.githubusercontent.com/u/3878466?v=4)](https://github.com/draaslan "draaslan (1 commits)")

---

Tags

phplaraveltranslategoogle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oytunistrator-google-translate/health.svg)

```
[![Health](https://phpackages.com/badges/oytunistrator-google-translate/health.svg)](https://phpackages.com/packages/oytunistrator-google-translate)
```

###  Alternatives

[stichoza/google-translate-php

Free Google Translate API PHP Package

2.0k7.6M124](/packages/stichoza-google-translate-php)[aurawindsurfing/google-translate

Free Laravel package for Paid Google Translate REST API with your own API key

1119.5k1](/packages/aurawindsurfing-google-translate)[gdg-tangier/cloud-pubsub

Google Cloud pub-sub for laravel

5054.9k](/packages/gdg-tangier-cloud-pubsub)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
