濮阳杆衣贸易有限公司

主頁 > 知識庫 > Laravel中validation驗證 返回中文提示 全局設置的方法

Laravel中validation驗證 返回中文提示 全局設置的方法

熱門標簽:智能電話機器人好公司門薩維 銅川電話機器人價格 聊城電話外呼系統(tǒng)公司 青白江地圖標注 沛縣400電話辦理 辦理重慶400電話 江蘇電商外呼系統(tǒng)運營商 AI電話機器人OEM貼牌 德陽中江如何申請400開頭電話

更改 resources\lang 目錄下邊的 validation.php

?php

return [

/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| the validator class. Some of these rules have multiple versions such
| as the size rules. Feel free to tweak each of these messages here.
|
*/

'accepted'       => ':attribute必須接受',
'active_url'      => ':attribute必須是一個合法的 URL',
'after'        => ':attribute 必須是 :date 之后的一個日期',
'after_or_equal'    => ':attribute 必須是 :date 之后或相同的一個日期',
'alpha'        => ':attribute只能包含字母',
'alpha_dash'      => ':attribute只能包含字母、數(shù)字、中劃線或下劃線',
'alpha_num'      => ':attribute只能包含字母和數(shù)字',
'array'        => ':attribute必須是一個數(shù)組',
'before'        => ':attribute 必須是 :date 之前的一個日期',
'before_or_equal'   => ':attribute 必須是 :date 之前或相同的一個日期',
'between'       => [
  'numeric' => ':attribute 必須在 :min 到 :max 之間',
  'file'  => ':attribute 必須在 :min 到 :max KB 之間',
  'string' => ':attribute 必須在 :min 到 :max 個字符之間',
  'array'  => ':attribute 必須在 :min 到 :max 項之間',
],
'boolean'       =>':attribute字符必須是 true 或false, 1 或 0 ',
'confirmed'      => ':attribute 二次確認不匹配',
'date'         => ':attribute 必須是一個合法的日期',
'date_format'     => ':attribute 與給定的格式 :format 不符合',
'different'      => ':attribute 必須不同于 :other',
'digits'        => ':attribute必須是 :digits 位.',
'digits_between'    => ':attribute 必須在 :min 和 :max 位之間',
'dimensions'      => ':attribute具有無效的圖片尺寸',
'distinct'       => ':attribute字段具有重復值',
'email'        => ':attribute必須是一個合法的電子郵件地址',
'exists'        => '選定的 :attribute 是無效的.',
'file'         => ':attribute必須是一個文件',
'filled'        => ':attribute的字段是必填的',
'image'        => ':attribute必須是 jpeg, png, bmp 或者 gif 格式的圖片',
'in'          => '選定的 :attribute 是無效的',
'in_array'       => ':attribute 字段不存在于 :other',
'integer'       => ':attribute 必須是個整數(shù)',
'ip'          => ':attribute必須是一個合法的 IP 地址。',
'json'         => ':attribute必須是一個合法的 JSON 字符串',
'max'         => [
  'numeric' => ':attribute 的最大長度為 :max 位',
  'file'  => ':attribute 的最大為 :max',
  'string' => ':attribute 的最大長度為 :max 字符',
  'array'  => ':attribute 的最大個數(shù)為 :max 個.',
],
'mimes'        => ':attribute 的文件類型必須是 :values',
'min'         => [
  'numeric' => ':attribute 的最小長度為 :min 位',
  'file'  => ':attribute 大小至少為 :min KB',
  'string' => ':attribute 的最小長度為 :min 字符',
  'array'  => ':attribute 至少有 :min 項',
],
'not_in'        => '選定的 :attribute 是無效的',
'numeric'       => ':attribute 必須是數(shù)字',
'present'       => ':attribute 字段必須存在',
'regex'        => ':attribute 格式是無效的',
'required'       => ':attribute 字段是必須的',
'required_if'     => ':attribute 字段是必須的當 :other 是 :value',
'required_unless'   => ':attribute 字段是必須的,除非 :other 是在 :values 中',
'required_with'    => ':attribute 字段是必須的當 :values 是存在的',
'required_with_all'  => ':attribute 字段是必須的當 :values 是存在的',
'required_without'   => ':attribute 字段是必須的當 :values 是不存在的',
'required_without_all' => ':attribute 字段是必須的當 沒有一個 :values 是存在的',
'same'         => ':attribute和:other必須匹配',
'size'         => [
  'numeric' => ':attribute 必須是 :size 位',
  'file'  => ':attribute 必須是 :size KB',
  'string' => ':attribute 必須是 :size 個字符',
  'array'  => ':attribute 必須包括 :size 項',
],
'string'        => ':attribute 必須是一個字符串',
'timezone'       => ':attribute 必須是個有效的時區(qū).',
'unique'        => ':attribute 已存在',
'url'         => ':attribute 無效的格式',

/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines
|--------------------------------------------------------------------------
|
| Here you may specify custom validation messages for attributes using the
| convention "attribute.rule" to name the lines. This makes it quick to
| specify a specific custom language line for a given attribute rule.
|
*/

'custom' => [
  'attribute-name' => [
    'rule-name' => 'custom-message',
  ],
],

/*
|--------------------------------------------------------------------------
| Custom Validation Attributes
|--------------------------------------------------------------------------
|
| The following language lines are used to swap attribute place-holders
| with something more reader friendly such as E-Mail Address instead
| of "email". This simply helps us make messages a little cleaner.
|
*/

'attributes' => [
  // 'name'     => '名字',
  // 'age'     => '年齡',
],

];

以上這篇Laravel中validation驗證 返回中文提示 全局設置的方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

您可能感興趣的文章:
  • laravel5.2表單驗證,并顯示錯誤信息的實例
  • 基于Laravel 5.2 regex驗證的正確寫法

標簽:烏魯木齊 鷹潭 迪慶 濟寧 三亞 山南 赤峰 南寧

巨人網(wǎng)絡通訊聲明:本文標題《Laravel中validation驗證 返回中文提示 全局設置的方法》,本文關鍵詞  Laravel,中,validation,驗證,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡,涉及言論、版權(quán)與本站無關。
  • 相關文章
  • 下面列出與本文章《Laravel中validation驗證 返回中文提示 全局設置的方法》相關的同類信息!
  • 本頁收集關于Laravel中validation驗證 返回中文提示 全局設置的方法的相關信息資訊供網(wǎng)民參考!
  • 推薦文章
    叙永县| 青田县| 赤壁市| 高邑县| 吉安市| 兰考县| 深圳市| 固始县| 克山县| 塘沽区| 临洮县| 日喀则市| 吴旗县| 大足县| 宾川县| 昭觉县| 太仓市| 张北县| 巴东县| 叶城县| 望江县| 忻城县| 托克逊县| 稷山县| 平陆县| 泰安市| 夹江县| 昭觉县| 精河县| 乌恰县| 本溪| 南京市| 无为县| 唐海县| 保定市| 大关县| 荆州市| 新巴尔虎左旗| 绥芬河市| 西充县| 永和县|