From a441ac132ad679d09e113c705993408fff7e0065 Mon Sep 17 00:00:00 2001 From: Daniel Pugsley Date: Fri, 11 Aug 2023 19:47:54 +0100 Subject: [PATCH 1/2] feat: added 'lang' parameter to photos search --- src/Search.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Search.php b/src/Search.php index 3b49e15..886bef3 100644 --- a/src/Search.php +++ b/src/Search.php @@ -26,7 +26,7 @@ class Search extends Endpoint * @return PageResult */ public static function photos($search, $page = 1, $per_page = 10, $orientation = null, $collections = null, - $order_by = null, $content_filter = "low", $color = null) + $order_by = null, $content_filter = "low", $color = null, $lang = null) { $query = [ 'query' => $search, @@ -54,6 +54,10 @@ public static function photos($search, $page = 1, $per_page = 10, $orientation = $query['color'] = $color; } + if ( ! empty($lang)) { + $query['lang'] = $lang; + } + $photos = self::get( "/search/photos", [ 'query' => $query ] From 7c3c2ecbf34fc78153cb1edb0dddd2dda38420df Mon Sep 17 00:00:00 2001 From: Daniel Pugsley Date: Fri, 11 Aug 2023 19:59:50 +0100 Subject: [PATCH 2/2] added param description --- src/Search.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Search.php b/src/Search.php index 886bef3..e4a24bd 100644 --- a/src/Search.php +++ b/src/Search.php @@ -23,6 +23,8 @@ class Search extends Endpoint * @param string $content_filter Limit results by content safety. (Optional; default: low). Valid values are low and high. * @param string $color Filter results by color. Optional. Valid values are: black_and_white, black, white, * yellow, orange, red, purple, magenta, green, teal, and blue. + * @param string $lang Search language code. Optional. Valid values here: + * https://unsplash.com/documentation#supported-languages * @return PageResult */ public static function photos($search, $page = 1, $per_page = 10, $orientation = null, $collections = null,