PHP code example of benriadh1 / laravel-filament-translation-manager

1. Go to this page and download the library: Download benriadh1/laravel-filament-translation-manager 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/ */

    

benriadh1 / laravel-filament-translation-manager example snippets


use Benriadh1\FilamentTranslationManager\BenriadhFilamentTranslationManagerPlugin;
use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel->plugins([
        BenriadhFilamentTranslationManagerPlugin::make(),
    ]);
}



use Filament\Support\Icons\Heroicon;

return [
    'locales' => [],
    'gate' => null,
    'ignore_groups' => [],
    'navigation_sort' => null,
    'navigation_group' => 'benriadh-filament-translation-manager::messages.navigation_group',
    'prefix_tabs' => [
        'sys' => 'System',
        'acc' => 'Accounting',
    ],
    'widget' => [
        'enabled' => false,
        'gate' => null,
        'sort' => null,
    ],
    'navigation_icon' => Heroicon::OutlinedLanguage,
];

'locales' => ['en', 'fr', 'de'],

'gate' => 'manage-translations',

'ignore_groups' => ['pagination', 'passwords'],

'navigation_group' => 'Settings',
'navigation_sort' => 90,

'navigation_icon' => null,

'prefix_tabs' => ['sys', 'acc'],

'prefix_tabs' => [
    'sys' => 'System Core',
    'acc' => 'Accounting',
],

'widget' => [
    'enabled' => true,
    'gate' => 'manage-translations',
    'sort' => 10,
],



return [
    'companies' => [
        'title' => 'Companies',
        'fields' => [
            'name' => 'Company name',
            'email' => 'Email',
        ],
        'actions' => [
            'create' => 'Create company',
            'edit' => 'Edit company',
        ],
    ],
];



use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

public static function form(Schema $schema): Schema
{
    return $schema->components([
        TextInput::make('name')
            ->label(__('sys.companies.fields.name'))
            ->

'prefix_tabs' => [
    'sys' => 'SYS',
],
bash
php artisan vendor:publish --tag=benriadh-filament-translation-manager-config
php artisan vendor:publish --tag=benriadh-filament-translation-manager-lang
php artisan vendor:publish --tag=benriadh-filament-translation-manager-views
bash
php artisan vendor:publish --tag=benriadh-filament-translation-manager-lang