Download the PHP package outerweb/filament-translatable-fields without Composer
On this page you can find all versions of the php package outerweb/filament-translatable-fields. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download outerweb/filament-translatable-fields
More information about outerweb/filament-translatable-fields
Files in outerweb/filament-translatable-fields
Package filament-translatable-fields
Short Description This package adds a way to interact with outerweb/translatable-fields in Filament.
License MIT
Homepage https://github.com/outer-web/filament-translatable-fields
Informations about the package filament-translatable-fields
Filament Translatable Fields
This package adds a way to make all filament fields translatable.
It uses the spatie/laravel-translatable
package in the background.
Installation
First install and configure your model(s) to use the spatie/laravel-translatable
package.
You can install the package via composer:
Add the plugin to your desired Filament panel:
You can specify the supported locales:
By default, the package will use the app.locale
if you don't specify the locales.
Combining with the official spatie-laravel-translatable-plugin?
This package is a replacement for the official on the create and edit pages only. If you are already using the official package, you will have to delete the use Translatable
trait and the LocaleSwitcher
header action from those pages:
Usage
You can simply add ->translatable()
to any field to make it translatable.
Disable translations dynamically
If you want to disable translations dynamically, you can set the first parameter of the ->translatable()
function to true
or false
.
Overwrite locales
If you want to overwrite the locales on a specific field you can set the locales through the second parameter of the ->translatable()
function.
Locale specific validation rules
You can add locale specific validation rules with the third parameter of the ->translatable()
method.
Good to know
This package will substitute the original field with a Filament\Forms\Components\Tabs
component. This component will render the original field for each locale.
All chained methods you add before calling ->translatable()
will be applied to the original field.
All chained methods you add after calling ->translatable()
will be applied to the Filament\Forms\Components\Tabs
component.
Laravel support
Laravel Version | Package version |
---|---|
^11.0 | ^1.0.2, ^2.0.0 |
^10.0 | ^1.0.0, ^2.0.0 |
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Simon Broekaert
- Finn Paes
- Vedat YILMAZ
- All Contributors
License
MIT License (MIT). Read the License File for more information.
All versions of filament-translatable-fields with dependencies
filament/filament Version ^3.2
laravel/framework Version ^10.0|^11.0
spatie/laravel-package-tools Version ^1.16
spatie/laravel-translatable Version ^6.6