diff --git a/src/Recipe/AdminRecipe.php b/src/Recipe/AdminRecipe.php index 13a6d3a..6e57127 100644 --- a/src/Recipe/AdminRecipe.php +++ b/src/Recipe/AdminRecipe.php @@ -6,6 +6,8 @@ use Megio\Collection\CollectionRequest; use Megio\Collection\ReadBuilder\Column\EmailColumn; use Megio\Collection\ReadBuilder\ReadBuilder; +use Megio\Collection\SearchBuilder\Searchable; +use Megio\Collection\SearchBuilder\SearchBuilder; use Megio\Collection\WriteBuilder\Field\Base\EmptyValue; use Megio\Collection\WriteBuilder\WriteBuilder; use Megio\Collection\WriteBuilder\Field\EmailField; @@ -26,6 +28,16 @@ public function key(): string return 'admin'; } + public function search(SearchBuilder $builder, CollectionRequest $request): SearchBuilder + { + $builder + ->keepDefaults() + ->addSearchable(new Searchable('email')) + ->addSearchable(new Searchable('lastLogin')); + + return $builder; + } + public function read(ReadBuilder $builder, CollectionRequest $request): ReadBuilder { return $builder->buildByDbSchema(['password']);