Download the PHP package levgenij/filament-translatable without Composer

On this page you can find all versions of the php package levgenij/filament-translatable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-translatable

Filament Translatable

Latest Version on Packagist License

Seamless multilingual support for Filament Resources with automatic translatable field generation based on levgenij/laravel-translatable.

📦 Version Compatibility

Please install the version that matches your Filament version:

Filament Version Package Version Branch Installation
Filament v5.x ^2.0 main composer require levgenij/filament-translatable:^2.0
Filament v3/v4 ^1.0 v1 composer require levgenij/filament-translatable:^1.0

Note: This documentation is for Filament v5. If you are using Filament v3 or v4, please switch to the v1 documentation.

Features

Requirements

Installation

Install the package via Composer:

The package will auto-register its service provider.

Publish Configuration (Optional)

Quick Start

1. Configure Your Model

Your model must use the Translatable trait from levgenij/laravel-translatable:

2. Add Trait to Resource

3. Add Trait to Create/Edit Pages

CreateRecord:

EditRecord:

That's it! Your form will now automatically display translatable fields in language tabs.

Configuration

Locales

By default, the package reads locales from config/translatable.php (the parent package). You can override this in config/filament-translatable.php:

Badge Style

Customize the locale badge appearance:

How It Works

Architecture

Data Flow

  1. Resource - The TranslatableResource trait provides the getTranslatableAttributes() method that reads the model's $translatable property.

  2. Page - The HasTranslatableFields trait intercepts the form() method and transforms the schema:

    • Finds fields that exist in $model->translatable
    • Groups them into language tabs (when multiple locales)
    • Adds locale badges to labels
    • Non-translatable fields remain unchanged
  3. Saving - The trait automatically:
    • Extracts translation data from the form
    • Saves them via $model->saveTranslation($locale, $data)

Form Data Structure

Data in the form is stored in this structure:

UI Behavior

Multiple Languages

When multiple languages are configured, translatable fields are grouped into tabs:

Single Language

When only one language is configured:

Advanced Usage

Overriding mutateFormDataBeforeFill

If you need additional logic when filling the form:

Overriding mutateFormDataBeforeCreate/Save

Custom Validation

Validation works as expected. Use the translations.{locale}.{field} path for custom rules:

Database Structure

The package works with levgenij/laravel-translatable which uses separate translation tables:

Troubleshooting

Fields are not transformed

Make sure that:

  1. Resource has use TranslatableResource;
  2. Page has use HasTranslatableFields;
  3. Model has $translatable property with correct fields
  4. Model uses use Levgenij\LaravelTranslatable\Translatable

Translations are not saved

Make sure that:

  1. Table {table}_translations exists
  2. Fields are in model's $fillable
  3. Fields are in model's $translatable

Error "Call to undefined method saveTranslation"

Model does not use the Levgenij\LaravelTranslatable\Translatable trait.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of filament-translatable with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^5.0
levgenij/laravel-translatable Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package levgenij/filament-translatable contains the following files

Loading the files please wait ...