PHP code example of tomatophp / filament-translations

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

    

tomatophp / filament-translations example snippets


$panel->plugin(\TomatoPHP\FilamentTranslations\FilamentTranslationsPlugin::make())

$panel->plugin(\TomatoPHP\FilamentTranslations\FilamentTranslationsPlugin::make()->allowCreate())

$panel->plugin(\TomatoPHP\FilamentTranslations\FilamentTranslationsPlugin::make()->allowClearTranslations())


'use_queue_on_scan' => true,


'path_to_custom_import_command' => ImportTranslations::class,

'path_to_custom_excel_import' => CustomTranslationImport::class,

'path_to_custom_excel_export' => CustomTranslationExport::class,

'show_import_button' => true,
'show_export_button' => false,
'show_scan_button' => false ,

    'navigation_group' => 'Settings',
    'navigation_icon' => 'heroicon-m-language',

'translation_resource' => CustomResource::class,

use TomatoPHP\FilamentTranslations\Filament\Resources\Translations\Table\TranslationTable;

public function boot()
{
    TranslationTable::register([
        \Filament\Tables\Columns\TextColumn::make('something')
    ]);
}

use TomatoPHP\FilamentTranslations\Filament\Resources\Translations\Table\TranslationActions;

public function boot()
{
    TranslationActions::register([
        \Filament\Tables\Actions\ReplicateAction::make()
    ]);
}

use TomatoPHP\FilamentTranslations\Filament\Resources\Translations\Table\TranslationFilters;

public function boot()
{
    TranslationFilters::register([
        \Filament\Tables\Filters\SelectFilter::make('something')
    ]);
}

use TomatoPHP\FilamentTranslations\Filament\Resources\Translations\Table\TranslationBulkActions;

public function boot()
{
    TranslationBulkActions::register([
        \Filament\Tables\BulkActions\DeleteAction::make()
    ]);
}

use TomatoPHP\FilamentTranslations\Filament\Resources\Translations\Form\TranslationForm;

public function boot()
{
    TranslationForm::register([
        \Filament\Forms\Components\TextInput::make('something')
    ]);
}

use TomatoPHP\FilamentTranslations\Filament\Resources\Translations\Pages\ManageTranslation;
use TomatoPHP\FilamentTranslations\Facade\FilamentTranslations;

public function boot()
{
    FilamentTranslations::register(Action::make(), ManageTranslation::class)
}
bash
php artisan filament-translations:install
bash
php artisan vendor:publish --tag="filament-translations-views"
bash
php artisan vendor:publish --tag="filament-translations-lang"
bash
php artisan vendor:publish --tag="filament-translations-migrations"
bash
composer analyse