mirror of
https://github.com/koel/koel
synced 2025-02-17 13:58:28 +00:00
perf: better array+exists validation rule
This commit is contained in:
parent
240794b4aa
commit
ea4a42d600
2 changed files with 2 additions and 3 deletions
|
@ -9,7 +9,7 @@ class DeleteSongsRequest extends Request
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'songs.*' => 'required|exists:songs,id',
|
||||
'songs' => 'required|array|exists:songs,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,7 @@ class RemoveSongsFromPlaylistRequest extends Request
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'songs' => 'required|array',
|
||||
'songs.*' => 'exists:songs,id',
|
||||
'songs' => 'required|array|exists:songs,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue