refactor(request): simplify brands filtering logic
Streamlined the filtering of brands in the IncoSheetsIndexRequest.
This commit is contained in:
parent
68de1fd224
commit
07559b87e5
1 changed files with 6 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue