refactor(request): simplify brands filtering logic

Streamlined the filtering of brands in the IncoSheetsIndexRequest.
This commit is contained in:
Jérémy Munsch 2026-08-14 12:18:55 +02:00
parent 68de1fd224
commit 07559b87e5
Signed by: forge-joniko
GPG key ID: D7EFE2F5CB6CC0E4

View file

@ -65,14 +65,12 @@ final class IncoSheetsIndexRequest extends FormRequest
$since = $this->filled('since') ? DatesHelper::parseDateTime($this->string('since')->value()) : null;
$brands = [];
$rawBrands = $this->input('brands');
if (is_array($rawBrands)) {
foreach ($rawBrands as $b) {
if (is_string($b) || is_numeric($b)) {
$val = trim((string) $b);
if ($val !== '') {
$brands[] = $val;
}
$rawBrands = $this->array('brands');
foreach ($rawBrands as $b) {
if (is_string($b) || is_numeric($b)) {
$val = trim((string) $b);
if ($val !== '') {
$brands[] = $val;
}
}
}