Level 2
should I be use Validator::make to make it work !?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to check some values inside an array if they are unique in some database tables column:
selectedCruds fields request:
array:4 [▼
0 => "create-course"
1 => "edit-course"
2 => "update-course"
3 => "delete-course"
]
Now I want to check if the values are unique inside permissions table,name..
I tried this but its not working :
$this->validate(
$request,
[
'selectedCruds.*'=>'unique:permissions,name',
]
);
am I using (.*) right !?
Please or to participate in this conversation.