From b4dfc6447662628f7696f2c927a92a6a66ad2606 Mon Sep 17 00:00:00 2001 From: Ethan Date: Mon, 7 Nov 2016 09:29:19 -0800 Subject: [PATCH] added config and loading of searchable fields --- config/entrust-gui.php | 1 + src/Repositories/UserRepositoryEloquent.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config/entrust-gui.php b/config/entrust-gui.php index cfc664a..b3ba9ce 100644 --- a/config/entrust-gui.php +++ b/config/entrust-gui.php @@ -13,5 +13,6 @@ "confirmable" => false, "users" => [ 'deletable' => true, + 'fieldSearchable' => [], ], ]; diff --git a/src/Repositories/UserRepositoryEloquent.php b/src/Repositories/UserRepositoryEloquent.php index 523d1fb..422eebb 100644 --- a/src/Repositories/UserRepositoryEloquent.php +++ b/src/Repositories/UserRepositoryEloquent.php @@ -1,5 +1,6 @@ fieldSearchable = config('entrust-gui.users.fieldSearchable', []); + } + /** * Specify Model class name * @@ -71,7 +78,7 @@ public function update(array $attributes, $id) $model = $this->find($id); if (! in_array('Esensi\Model\Contracts\HashingModelInterface', class_implements($model))) { throw new Exception( - "User model must implement Esensi\Model\Contracts\HashingModelInterface. + "User model must implement Esensi\Model\Contracts\HashingModelInterface. Revert to 0.3.* or see upgrade guide for details." ); }