PHP code example of genius-asif / laravel-lang-ai-translate

1. Go to this page and download the library: Download genius-asif/laravel-lang-ai-translate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

genius-asif / laravel-lang-ai-translate example snippets




return [
    'languages' => [
        'hi' => 'Hindi',
        'es' => 'Spanish',
        'fr' => 'French',
        'ur' => 'Urdu',
    ],
    'providers' => [
        'google_gemini' => [
            'key' => env('GOOGLE_GEMINI_API_KEY', ''),
            'url' => env('GOOGLE_GEMINI_API_URL', '[https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=](https://www.google.com/search?q=https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent%3Fkey%3D)' . env('GOOGLE_GEMINI_API_KEY')),
        ],
        'openai' => [
            'key' => env('OPENAI_API_KEY', ''),
            'url' => env('OPENAI_API_URL', '[https://api.openai.com/v1/chat/completions](https://api.openai.com/v1/chat/completions)'),
        ],
        'deepseek' => [
            'key' => env('DEEPSEEK_API_KEY', ''),
            'url' => env('DEEPSEEK_API_URL', '[https://api.deepseek.com/chat/completions](https://api.deepseek.com/chat/completions)'),
        ],
    ],
];
bash
php artisan vendor:publish --tag="lang-ai-translation"
bash
php artisan lang:translate