From 66f9a8f2d71525820e3f51d40bff7f027bf5c54f Mon Sep 17 00:00:00 2001 From: WDDA Date: Fri, 17 Mar 2023 20:27:28 +0300 Subject: [PATCH] optimize list fies --- app/Models/Resources/Files.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Models/Resources/Files.php b/app/Models/Resources/Files.php index 40a9c1a..58e9948 100644 --- a/app/Models/Resources/Files.php +++ b/app/Models/Resources/Files.php @@ -34,6 +34,12 @@ public static function getList(Collection $params): array $result = []; foreach ($files as $file) { + if ($params->get('name')) { + if (!str_contains(basename($file), $params->get('name'))) { + continue; + } + } + $result[] = [ 'name' => basename($file), 'path' => $path,