Skip to content

Commit ea373ea

Browse files
committed
adding attributes to filter, allows for attributes in use with custom filter views, maybe allow for future support of attributes on generic filter views
1 parent 40add52 commit ea373ea

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Views/Filter.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,30 @@ class Filter
2828
*/
2929
public array $options = [];
3030

31+
/**
32+
* @var array
33+
*/
34+
public array $attributes = [];
35+
3136
/**
3237
* Filter constructor.
3338
*
3439
* @param string $name
3540
*/
36-
public function __construct(string $name)
41+
public function __construct(string $name, ?array $attributes = [])
3742
{
3843
$this->name = $name;
44+
$this->attributes = $attributes;
3945
}
4046

4147
/**
4248
* @param string $name
4349
*
4450
* @return Filter
4551
*/
46-
public static function make(string $name): Filter
52+
public static function make(string $name, ?array $attributes = []): Filter
4753
{
48-
return new static($name);
54+
return new static($name, $attributes);
4955
}
5056

5157
/**

0 commit comments

Comments
 (0)