morimorim/laravel-flexisble-translator

Laravel Flexible Translator

0.0.1 2023-12-02 05:14 UTC

This package is auto-updated.

Last update: 2024-10-31 00:25:52 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);