Skip to content

add method resolveTableName, support model input#7551

Open
tw2066 wants to merge 2 commits intohyperf:masterfrom
tw2066:validation-model
Open

add method resolveTableName, support model input#7551
tw2066 wants to merge 2 commits intohyperf:masterfrom
tw2066:validation-model

Conversation

@tw2066
Copy link
Contributor

@tw2066 tw2066 commented Sep 30, 2025

使用模型来确定表名称

unique:table,column
验证字段在给定的数据库表中不得存在。

指定自定义表/列名称:

您可以指定应使用哪个 Eloquent 模型来确定表名称,而不是直接指定表名称:

'email' => 'unique:App\Models\User,email_address'

您可以指定应使用哪个 Eloquent 模型来确定表名称,而不是直接指定表名称:

'user_id' => 'exists:App\Models\User,id'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant