PHP code example of codewithdennis / filament-translate-field

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

    

codewithdennis / filament-translate-field example snippets




return [

    /*
     * Automatically detect the language of the text to translate.
     *
     * Whether to automatically detect the language of the text to translate.
     */

    'auto_detect' => true,

    /*
     * The default language to translate to.
     *
     * This should be the key of the language in the languages array.
     */

    'default_language' => 'en',

    /*
     * The languages that the user can translate to.
     *
     * The key should be the language code and the value should be the language name.
     */

    'languages' => [
        'en' => 'English',
    ],
];


return [
    'languages' => [
        'en' => 'English',
        'es' => 'Spanish',
    ],
];

return [
    'languages' => App\Enums\Languages::class,
];

TranslateAction::make()
    ->modalSubmitAction(false)
    ->modalCancelAction(false),

use CodeWithDennis\FilamentTranslateField\Filament\Forms\Actions\TranslateAction;

Forms\Components\Textarea::make('description')
    ->hintAction(TranslateAction::make())
    ->columnSpanFull()
    ->rows(3),
bash
composer