Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added config and loading of searchable fields #23

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/entrust-gui.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"confirmable" => false,
"users" => [
'deletable' => true,
'fieldSearchable' => [],
],
];
9 changes: 8 additions & 1 deletion src/Repositories/UserRepositoryEloquent.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace Acoustep\EntrustGui\Repositories;

use Illuminate\Container\Container as Application;
use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Criteria\RequestCriteria;
use App\Entities\User;
Expand All @@ -16,6 +17,12 @@
*/
class UserRepositoryEloquent extends BaseRepository implements UserRepository
{

public function __construct(Application $app) {
parent::__construct($app);
$this->fieldSearchable = config('entrust-gui.users.fieldSearchable', []);
}

/**
* Specify Model class name
*
Expand Down Expand Up @@ -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."
);
}
Expand Down