Level 3
Can you clarify your question?
Are you asking for a validation rule that checks to make sure that each "Reseller Address" is unique to an "Organization"?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Firstly, this is the relationships of my tables
//Organization Class
public function resellers()
{
return $this->hasMany(Reseller::class);
}
//Reseller Class
public function organization()
{
return $this->belongsTo(Organization ::class);
}
public function addresses()
{
return $this->hasMany(ResellerAddress::class, 'reseller_id');
}
//ResellerAddress::class
public function reseller()
{
return $this->belongsTo(Reseller::class, 'reseller_id');
}
How do you implement unique validation to a field that belongs to ResellerAddress but considers that it is unique only to the Organization?
Please or to participate in this conversation.