Laravel Google Translate is a good Laravel package that we can use to translate our files to other languages automatically using stichoza/google-translate-php or Google Translate API.

laravel google translate

Installation

composer require tanmuhittin/laravel-google-translate --dev

php artisan vendor:publish --provider=Tanmuhittin\LaravelGoogleTranslate\LaravelGoogleTranslateServiceProvider

If you would like to use stichoza/google-translate-php you do not need an API key. If you would like to use Google Translate API, edit config/laravel_google_translate.php and add your Google Translate API key.

php artisan config:cache

Then you can run

php artisan translate:files

Source Code

https://github.com/tanmuhittin/laravel-google-translate

If you like this article, don't forget to share it. Thank you.