How to give custom field name in laravel form validation error message

前端 未结 6 1154
没有蜡笔的小新
没有蜡笔的小新 2021-01-07 20:21

I was trying form validation in laravel. I have a input text field in my form called \'Category\' and i\'m given the field name as \'cat\' as short.

And i defined

6条回答
  •  北荒
    北荒 (楼主)
    2021-01-07 20:44

    you can customize every message ,also change the attribute fields name in validation.php (resources/lang/en/). for set the attribute in validation.php

    'attributes' => [
       'name' => 'Name',
       'cat' => 'Category',
       'field_name'=>'your attribute'
    ],
    

提交回复
热议问题