Remove Postgres specific database features
This commit is contained in:
parent
b62838e81f
commit
710326e479
|
@ -27,11 +27,11 @@ class Contact extends Model
|
||||||
{
|
{
|
||||||
$query->when($filters['search'] ?? null, function ($query, $search) {
|
$query->when($filters['search'] ?? null, function ($query, $search) {
|
||||||
$query->where(function ($query) use ($search) {
|
$query->where(function ($query) use ($search) {
|
||||||
$query->where('first_name', 'ilike', '%'.$search.'%')
|
$query->where('first_name', 'like', '%'.$search.'%')
|
||||||
->orWhere('last_name', 'ilike', '%'.$search.'%')
|
->orWhere('last_name', 'like', '%'.$search.'%')
|
||||||
->orWhere('email', 'ilike', '%'.$search.'%')
|
->orWhere('email', 'like', '%'.$search.'%')
|
||||||
->orWhereHas('organization', function ($query) use ($search) {
|
->orWhereHas('organization', function ($query) use ($search) {
|
||||||
$query->where('name', 'ilike', '%'.$search.'%');
|
$query->where('name', 'like', '%'.$search.'%');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})->when($filters['trashed'] ?? null, function ($query, $trashed) {
|
})->when($filters['trashed'] ?? null, function ($query, $trashed) {
|
||||||
|
|
|
@ -16,7 +16,7 @@ class Organization extends Model
|
||||||
public function scopeFilter($query, array $filters)
|
public function scopeFilter($query, array $filters)
|
||||||
{
|
{
|
||||||
$query->when($filters['search'] ?? null, function ($query, $search) {
|
$query->when($filters['search'] ?? null, function ($query, $search) {
|
||||||
$query->where('name', 'ilike', '%'.$search.'%');
|
$query->where('name', 'like', '%'.$search.'%');
|
||||||
})->when($filters['trashed'] ?? null, function ($query, $trashed) {
|
})->when($filters['trashed'] ?? null, function ($query, $trashed) {
|
||||||
if ($trashed === 'with') {
|
if ($trashed === 'with') {
|
||||||
$query->withTrashed();
|
$query->withTrashed();
|
||||||
|
|
|
@ -45,9 +45,9 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
|
||||||
{
|
{
|
||||||
$query->when($filters['search'] ?? null, function ($query, $search) {
|
$query->when($filters['search'] ?? null, function ($query, $search) {
|
||||||
$query->where(function ($query) use ($search) {
|
$query->where(function ($query) use ($search) {
|
||||||
$query->where('first_name', 'ilike', '%'.$search.'%')
|
$query->where('first_name', 'like', '%'.$search.'%')
|
||||||
->orWhere('last_name', 'ilike', '%'.$search.'%')
|
->orWhere('last_name', 'like', '%'.$search.'%')
|
||||||
->orWhere('email', 'ilike', '%'.$search.'%');
|
->orWhere('email', 'like', '%'.$search.'%');
|
||||||
});
|
});
|
||||||
})->when($filters['role'] ?? null, function ($query, $role) {
|
})->when($filters['role'] ?? null, function ($query, $role) {
|
||||||
$query->whereRole($role);
|
$query->whereRole($role);
|
||||||
|
|
Loading…
Reference in New Issue