PHP code example of overtrue / laravel-lang

1. Go to this page and download the library: Download overtrue/laravel-lang library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

overtrue / laravel-lang example snippets


$app->register(Overtrue\LaravelLang\TranslationServiceProvider::class);

'locale' => 'zh_CN',



return [
    'user_not_exists'    => '用户不存在',
    'email_has_registed' => '邮箱 :email 已经注册过!',
];

echo trans('demo.user_not_exists'); // 用户不存在
echo trans('demo.email_has_registed', ['email' => '[email protected]']);
// 邮箱 [email protected] 已经注册过!



return [
    'reset' => '您的密码已经重置成功了,你可以使用新的密码登录了!',
];
shell
php artisan lang:publish [LOCALES] {--force}
shell
php artisan lang:publish zh_CN,zh_HK,th,tk