Closed wemteqdev closed 5 years ago
You could use setErrors
to manually set the error bag, I suppose in this instance you would want to get the error bag, append to it and set it again. However, it's not something I'd be looking to support normally. For your example, it sounds more like something that would be handled by a policy rather than validation.
Is it possible to add custom validation error to model? something like following.
if (!$video->published()){ $video->addError('notification', 'can be sent for only published videos') }