unique rules depending on other field

i have field volume_name and book_name in sections table

i want a rule that make unique book_name depends on volume name

volume_name book_name
volume 1 book 1
volume 1 book 2

so when i encode volume 1 book 1 it will have validated error. Here's my code
image.png
Was this page helpful?