morimorim/laravel-flexisble-translator

Laravel Flexible Translator

0.0.1 2023-12-02 05:14 UTC

This package is auto-updated.

Last update: 2024-12-01 00:09:30 UTC


README

This is package of translations for Laravel

See also example.

Install

composer require morimorim/laravel-flexisble-translator

Usage

1.Run migrate to create translations table

php artisan migrate

2.Insert translations

Translation::create([
    'key' => self::KEY_DB,
    'texts' => [
        'ja' => '(DB) :num δΎ‹',
        'en' => '(DB) example :num',
    ],
]);

3.Use trans like same as default.

trans('messages.example');
__('messages.example');
Lang::choice('messages.example.choice', 10);