laravel实践11.验证提示信息多语言版本
1,一般修改验证提示信息语言:
resources/lang/cn/validation.php
'custom' => [ 'email' => [ 'required' => '邮箱地址不能为空!', ], ],
2.也可以安装语言包扩展:
composer require "overtrue/laravel-lang:~3.0"
安装成功后,在 config/app.php
文件中将以下这一行:
Illuminate\Translation\TranslationServiceProvider::class,
替换为:
Overtrue\LaravelLang\TranslationServiceProvider::class,
并在config/app.php设置:
<?php return [ . . . 'locale' => 'zh-CN', . . . ];