PHP code example of pxlrbt / filament-translate-action

1. Go to this page and download the library: Download pxlrbt/filament-translate-action 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/ */

    

pxlrbt / filament-translate-action example snippets


use pxlrbt\FilamentTranslateAction\Filament\Actions\TranslateAction

public function boot(): void
{
    // ...
    TranslateAction::apiKey('your-api-key');
    // ...
}

class EditUser extends \Filament\Resources\Pages\EditRecord
{
    // ...
    protected function getHeaderActions(): array
    {
        return [
            TranslateAction::make()
                ->sourceLocale('de'),
        ];
    }    
}