From 710326e479ce5b15a1ac8da11b0ee1544e560564 Mon Sep 17 00:00:00 2001 From: Jonathan Reinink Date: Tue, 2 Apr 2019 13:05:17 -0400 Subject: [PATCH] Remove Postgres specific database features --- app/Contact.php | 8 ++++---- app/Organization.php | 2 +- app/User.php | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Contact.php b/app/Contact.php index 4df5c2e..d71a774 100644 --- a/app/Contact.php +++ b/app/Contact.php @@ -27,11 +27,11 @@ class Contact extends Model { $query->when($filters['search'] ?? null, function ($query, $search) { $query->where(function ($query) use ($search) { - $query->where('first_name', 'ilike', '%'.$search.'%') - ->orWhere('last_name', 'ilike', '%'.$search.'%') - ->orWhere('email', 'ilike', '%'.$search.'%') + $query->where('first_name', 'like', '%'.$search.'%') + ->orWhere('last_name', 'like', '%'.$search.'%') + ->orWhere('email', 'like', '%'.$search.'%') ->orWhereHas('organization', function ($query) use ($search) { - $query->where('name', 'ilike', '%'.$search.'%'); + $query->where('name', 'like', '%'.$search.'%'); }); }); })->when($filters['trashed'] ?? null, function ($query, $trashed) { diff --git a/app/Organization.php b/app/Organization.php index 49330bf..fa3a15b 100644 --- a/app/Organization.php +++ b/app/Organization.php @@ -16,7 +16,7 @@ class Organization extends Model public function scopeFilter($query, array $filters) { $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) { if ($trashed === 'with') { $query->withTrashed(); diff --git a/app/User.php b/app/User.php index 82e5e0a..8272241 100644 --- a/app/User.php +++ b/app/User.php @@ -45,9 +45,9 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac { $query->when($filters['search'] ?? null, function ($query, $search) { $query->where(function ($query) use ($search) { - $query->where('first_name', 'ilike', '%'.$search.'%') - ->orWhere('last_name', 'ilike', '%'.$search.'%') - ->orWhere('email', 'ilike', '%'.$search.'%'); + $query->where('first_name', 'like', '%'.$search.'%') + ->orWhere('last_name', 'like', '%'.$search.'%') + ->orWhere('email', 'like', '%'.$search.'%'); }); })->when($filters['role'] ?? null, function ($query, $role) { $query->whereRole($role);