Download the PHP package maggomann/filament-model-translator without Composer
On this page you can find all versions of the php package maggomann/filament-model-translator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maggomann/filament-model-translator
More information about maggomann/filament-model-translator
Files in maggomann/filament-model-translator
Package filament-model-translator
Short Description The package translates the Eloquent models using a currently specified translation file. The Eloquent models are used internally in [filament's](https://filamentphp.com/) Resources and RelationManagers for translation. This package provides traits for the Resources and RelationManagers to translate them automatically.
License MIT
Homepage https://github.com/maggomann/filament-model-translator
Informations about the package filament-model-translator
Filament model translator package for filament v3.x
This package is tailored for Filament Admin Panel v3.x.
Make sure you have installed the admin panel before you continue with the installation. You can check the documentation here
The package translates the Eloquent models using a currently specified translation file. The Eloquent models are used internally in filament's Resources and RelationManagers for translation. This package provides traits for the Resources and RelationManagers to translate them automatically.
Supported Versions
PHP Versions | Laravel Versions |
---|---|
8.3, 8.2, 8.1 | 10.* |
8.3, 8.2 | 11.* |
Installation
You can install the package via composer:
Add the plugin to your desired Filament panel:
How is it used?
The language files
The translations are currently called from the filament-model.php
translation file, which must be located in the following directory tree:
The filament-model.php
file within the package serves as a structured language file for translations. It enables defining translations for various entities such as models, their attributes, and navigation elements.
This file offers a structured way to organize language translations for various aspects of your application:
- Models: Here, you can define translations for the names of your models, both in singular and plural forms.
- Attributes: Contains translations for the different attributes of each model. For instance, you can set translations for attributes like name, slug, created_at, etc.
- Navigation: Defines translations for the navigation groups associated with the models. In this case, the navigation group for each model is set to 'Seasons & Tournaments'.
The trait HasTranslateableResources for the resource classes
The trait HasTranslateableResources
internally translates the method calls automatically:
Example:
Or:
The trait HasTranslateableRelationManager for the relation classes
The trait HasTranslateableRelationManager
internally translates the method calls automatically:
You can use the trait HasTranslateableRelationManager
in the following ways:
Example:
Or:
The trait HasTranslateableModel for the eloquent classes
The following method calls are available with the trait HasTranslateableModel
:
You can use the trait HasTranslateableModel
in the following ways:
Example:
Or:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Marco Ehrt
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Disclaimer
Please note that these packages for Filament are not officially operated by Filament and do not provide any support or warranty from the Filament team. The use of these packages is at your own risk.
This project represents unofficial extensions for Filament and is maintained by an independent community of developers. We strive to maintain compatibility with the current versions of Filament, but we cannot guarantee that the packages will function flawlessly or be compatible with future versions of Filament.
We recommend users to create backups of their projects and thoroughly test them before using these packages. If you have any questions, issues, or suggestions, we are available to assist you. However, please note that we cannot provide official support for these packages.
We would like to emphasize that Filament is a separate developer community independent of this project. For more information about Filament, please refer to the official Filament website.
Please read the license terms to learn more about the conditions for using these packages.