froemic
2 years ago

Validating Destroy Request

Posted 2 years ago by froemic

I have a DB Model with Students and Classes. Several students belong to one class.

If the user wants to delete a class with students assigned to it, this request SHOULD fail. However, it does fail with an SQL Integrity Constraint violation, because I could not figure out how to test for this case with Laravel's validator. Any ideas?

Please sign in or create an account to participate in this conversation.