Laravel 5.5 unique validation rule on seperate table with different column name

前端 未结 1 994
伪装坚强ぢ
伪装坚强ぢ 2021-01-05 04:42

So I have users and companies. A user belongs to one company.

I want to validate a user registration so that the business_name field they use to registe

相关标签:
1条回答
  • 2021-01-05 05:22

    Never mind, managed to figure it out. Just needed an extra parameter to specify the column name:

    'business_name' => 'required|unique:companies,name',
    
    0 讨论(0)
提交回复
热议问题