In my case,Many tables has the column called name
.In English,This word can use in everywhere,In different scene it represents different meanings. But in Chinese,This word can be translated to many different word like 名字
which means personal name
,名称
which means item name
and so on.
This is a simple example,In the lang files,I can only defined an array,'attributes'=>['name'=>'名字']
I have an idea and Laravel
did not implement this feature,Like this:
'attributes'=>['table_name.column_name'=>'名字']
.
Any suggestions?
So you'll have to use either of the following:
$this->validate($request, [...])
you can use the custom error messagesattributes()
function to help youActually I'm using Laravel Nova and It's not provide a method to define custom error messages or custom attributes. So I have try to find another way.
Looks like is Nova's issue.
By the way,I think the good way to resolve this issue is handle it in Lang files.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community