-
$this- > validate(), Validator::make(), and Requests for $this- > validate().
-
$this->validate(); $this->validate(); $this->validate(); $this->validate(); $this->validate();
-
Find the effect error folder resources/lang in the project and find that the corresponding file is the effect rule and error message, but it is in English, just change it into Chinese.
-
In packagist, search for lang and find Laravel-lang, which has translated effect error file prompt. If you only need Chinese, find zh_CN file inside, which also supports multiple countries or regions of the language package.
-
Once you have downloaded laravel-lang, copy the zh_CN folder into the project resources/lang folder at the same level as the en file
-
Go to config/app.php and change ‘locale’ => ‘en’ to ‘locale’ => ‘zh_CN’
-
On the second visit, the effect error becomes Chinese.