|int $playlists */ class PlaylistFolderPlaylistStoreRequest extends Request { /** @return array */ public function rules(): array { return [ 'playlists' => ['required', 'array', new AllPlaylistsBelongToUser($this->user())], 'playlists.*' => [Rule::exists(Playlist::class, 'id')], ]; } }