Language Tabs by pixelpeter
CommunityGroup multilingual fields into tabs. It can be configured which languages are required to be filled out.
Package health
Automated checks of this plugin's Composer package
15 checks
- Failed: GitHub Actions pinned to SHA — View details on Plumb
- Skipped: GitLab CI includes pinned to SHA
- Passed: Open security advisories
- Passed: Dependabot PR responsiveness — No open Dependabot PRs.
- Skipped: Renovate MR responsiveness
- Passed: Dependabot or Renovate configured
-
Failed:
Dependency update cooldown configured
—
No cooldown configured in
.github/dependabot.yml. View details on Plumb - Passed: Provides a security policy
- Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
- Passed: Commit and release recency — Active: last commit 0 days ago; last release 398 days ago.
-
Passed:
composer.lock not committed by library
—
composer.lockis absent from the released dist archive. - Passed: Dist archive is lean
-
Passed:
Current Laravel version supported
— Package dependencies resolve together with current Laravel
13.0. -
Passed:
Current PHP version supported
— Constraint
^8.3|^8.4|^8.5supports current PHP8.5. - Skipped: Current Symfony version supported
filament/
namespace. Review the source and install at your own risk. Found
malware or an unresolved security issue the author won't
address?
Report it
.
Documentation
- Compatibility
- Requirements
- Installation
- Prerequisites
- Setup & configuration
- Testing
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
![]()
This package is a Filament plugin that allows you to group multilingual fields into tabs. It can be configured which languages are required to be filled out.
![]()
#Compatibility
From v4.0.0 on, the plugin's major version matches the Filament major version it supports: require ^5.0 for
Filament 5.x and ^4.0 for Filament 4.x.
Only these two lines are maintained. main is where the Filament 5.x line is developed; the v5.x branch tracks it
and carries the released state.
| Filament | composer | branch | development |
|---|---|---|---|
| v5.x | ^5.0 |
v5.x | main |
| v4.x | ^4.0 |
v4.x | v4.x |
#Deprecated releases
Releases before v4.0.0 used a different scheme, where the plugin's major version trailed the Filament major version
by one. They remain installable and unchanged, but they are no longer maintained: they receive no fixes and no further
releases.
| Filament | composer | branch | status |
|---|---|---|---|
| v4.x | ^3.0 |
v4.x | deprecated, superseded by ^4.0 |
| v3.x | ^2.0 |
v2.x | deprecated, no successor |
| v2.x | ^1.0 |
v1.x | deprecated, no successor |
#Requirements
| Requirement | Versions |
|---|---|
| PHP | 8.3, 8.4, 8.5 |
| Laravel | 12.x, 13.x |
| Filament | 5.x |
#Installation
Install the package via composer:
composer require pixelpeter/filament-language-tabs
Publish the config file with:
php artisan vendor:publish --tag="filament-language-tabs-config"
Optionally, publish the view:
php artisan vendor:publish --tag="filament-language-tabs-views"
This is the contents of the published config file:
return [
/*
|--------------------------------------------------------------------------
| Default Locales
|--------------------------------------------------------------------------
|
| These are the locales this package will use generate the tabs
|
*/
'default_locales' => ['de', 'en', 'fr'],
/*
|--------------------------------------------------------------------------
| Required Locales
|--------------------------------------------------------------------------
|
| These are the locales this package will use to set the field as required
| This can be used if one translation or language is optional
|
*/
'required_locales' => ['de', 'en'],
];
#Prerequisites
#Install spatie-translatable
composer require spatie/laravel-translatable
#Create a model and make it translatable
// Models/Post.php
class Post extends Model
{
use HasFactory, HasTranslations;
public $translatable = ['headline', 'body', 'slug'];
protected $casts = [
'headline' => 'array',
'body' => 'array',
'slug' => 'array',
];
protected $guarded = ['id'];
}
#Create a migration for the model
// database/migrations
...
public function up(): void
{
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->json('headline');
$table->json('slug');
$table->json('body');
$table->timestamps();
});
}
...
#Setup & configuration
#FilamentPHP V4.x
#Method 1 (preferred): Add the LanguageTabs component to the PostForm schema
// app/Filament/Resources/Posts/Schemas/PostForm.php
...
use Pixelpeter\FilamentLanguageTabs\Forms\Components\LanguageTabs;
class PostForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
LanguageTabs::make([
TextInput::make('headline')->label('headline')->required(),
TextInput::make('slug')->label('slug'),
MarkdownEditor::make('body')->label('body'),
]),
]);
}
}
#Method 2: Add the LanguageTabs component directly to the Filament resource
// app/Filament/Resources/PostResource.php
...
use Pixelpeter\FilamentLanguageTabs\Forms\Components\LanguageTabs;
class PostResource extends Resource
{
public static function form(Form $form): Form
{
return $form
->components([
LanguageTabs::make([
Forms\Components\TextInput::make('headline')->label('headline')->required(),
Forms\Components\TextInput::make('slug')->label('slug'),
Forms\Components\MarkdownEditor::make('body')->label('body'),
]),
]);
}
#FilamentPHP V3.x
#Add the LanguageTabs component to your Filament resource
// app/Filament/Resources/PostResource.php
...
use Pixelpeter\FilamentLanguageTabs\Forms\Components\LanguageTabs;
class PostResource extends Resource
{
public static function form(Form $form): Form
{
return $form
->schema([
LanguageTabs::make([
Forms\Components\TextInput::make('headline')->label('headline')->required(),
Forms\Components\TextInput::make('slug')->label('slug'),
Forms\Components\MarkdownEditor::make('body')->label('body'),
]),
]);
}
#Configure which languages to add to the tabs
// config/filament-language-tabs.php
return [
'default_locales' => ['de', 'en', 'fr'],
]
#Configure for which languages a field is required
If a field is defined as required
...
->schema([
Forms\Components\TextInput::make('headline')->label('headline')->required(),
...
]),
...
it will only be set as required for the languages configured in required_locals
// config/filament-language-tabs.php
return [
'required_locales' => ['de', 'en'],
]
The headline is not (marked as) required for French language
#Testing
./vendor/bin/pest
#Changelog
Please see CHANGELOG for more information on what has changed recently.
#Contributing
Please see CONTRIBUTING for details.
#Security Vulnerabilities
Please review the security policy on how to report security vulnerabilities.
#Credits
- pixelpeter
- Thanks to ralphjsmit for the inspiration of creating a TestableForm to help with testing this component
- All Contributors
#License
The MIT License (MIT). Please see License File for more information.
The author
Full-Stack Engineer from 🇩🇪 who is in ❤️ with the TALL stack and also proficient with Javascript, Typescript, Python and a lot of other stuff because he has to 🤪. Maybe someday there will be a real homepage
Featured Plugins
A selection of plugins curated by the Filament team
Sharp Theme
A theme that gives panels a precise, technical look with square corners, strong borders, and clear contrast.
Filament
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese
Custom Fields
Eliminate custom field migrations forever. Let your users create and manage form fields directly in Filament admin panels with 20+ built-in field types, validation, and zero database changes.
Relaticle