first commit
This commit is contained in:
21
app/Filters/Auth/Permissions.php
Normal file
21
app/Filters/Auth/Permissions.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Auth;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Permissions extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('display_name', $query);
|
||||
}
|
||||
}
|
||||
21
app/Filters/Auth/Roles.php
Normal file
21
app/Filters/Auth/Roles.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Auth;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Roles extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('display_name', $query);
|
||||
}
|
||||
}
|
||||
26
app/Filters/Auth/Users.php
Normal file
26
app/Filters/Auth/Users.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Auth;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Users extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('name', $query);
|
||||
}
|
||||
|
||||
public function role($roles)
|
||||
{
|
||||
return $this->where('user_roles.role_id', $roles);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user