I'm having some issues with the Codeigniter 4 validation rules. I'm using the is_unique function within the ruleset in Order to except one single row from the validation.
The problem here is that there are two fields in the table that need to be checked:
Is it possible, to make the exception depending on 2 or more fields?
I want to check the episodeID AND the podcastID not only one of these values.
The problem here is that there are two fields in the table that need to be checked:
Code:
'episodeTitle' => [
'label' => 'episodeTitle',
'rules' => 'required|max_length[100]|is_unique[episodes.episodeTitle,episodes.episodeID,' . $episodeID . ',episodes.podcastID,' . $podcastID . ']',
'errors' => [
'required' => lang('Errors.nested.episode.episodeTitleRequired'),
'max_length' => lang('Errors.nested.messages.maxLength100'),
'is_unique' => lang('Errors.nested.episode.episodeTitleUnique'),
],
],
Is it possible, to make the exception depending on 2 or more fields?
I want to check the episodeID AND the podcastID not only one of these values.