Download the PHP package tabaoman/laravel-translation without Composer
On this page you can find all versions of the php package tabaoman/laravel-translation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download tabaoman/laravel-translation
More information about tabaoman/laravel-translation
Files in tabaoman/laravel-translation
Download tabaoman/laravel-translation
More information about tabaoman/laravel-translation
Files in tabaoman/laravel-translation
Vendor tabaoman
Package laravel-translation
Short Description An i18n solution with Laravel
License MIT
Package laravel-translation
Short Description An i18n solution with Laravel
License MIT
Please rate this library. Is it a good library?
Informations about the package laravel-translation
Guide
A i18n solution with Laravel
This is a Laravel package for i18n. You just need to create just ONE more table to manage ALL multi-language texts for your other Eloquent entities.
Installation
Basic Use
Change the new config file 'translation.php'
Create the table
NOTE: Do NOT create with timestamp fields ('create_time', 'update_time' here) if using 'table' in translation config.
CREATE TABLE `t_language_translate` (
`id` BIGINT(18) NOT NULL AUTO_INCREMENT,
`entity_id` VARCHAR(32) NOT NULL COMMENT 'model id',
`lang_code` VARCHAR(18) NOT NULL COMMENT 'language code',
`text_code` VARCHAR(18) NOT NULL COMMENT 'text code',
`content` LONGTEXT NOT NULL COMMENT 'text',
`create_time` DATETIME NOT NULL COMMENT 'created time',
`update_time` DATETIME NULL DEFAULT NULL COMMENT 'updated time',
PRIMARY KEY (`id`),
UNIQUE KEY unique_trans (`entity_id`, `lang_code`, `text_code`)
) COMMENT='i18n table' COLLATE='utf8mb4_general_ci' ENGINE=InnoDB;
Add trait and a new member variable '$translations' in model class
Getting translated attributes
Saving translated attributes
Flatten the i18n atrributes
In model class
Versions
Package | Laravel | PHP |
---|---|---|
**v0.*** | 5.8.* / 6.* |
>=7.2 |
All versions of laravel-translation with dependencies
PHP Build Version
Package Version
The package tabaoman/laravel-translation contains the following files
Loading the files please wait ....