generate_constraint_violation_handler
Generates a Laravel UniqueConstraintViolationException handler for a model's unique fields, providing column/index details and optional custom message.
Instructions
Generate Laravel 13.2 UniqueConstraintViolationException handler with column/index details.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"modelName": "<modelName>",
"fields": "<fields>"
},
"name": "generate_constraint_violation_handler"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | Yes | Fields that have unique constraints e.g. ['email', 'username'] | |
| modelName | Yes | Model name e.g. 'User' | |
| customMessage | No |