Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 710326e4
authored
Apr 02, 2019
by
Jonathan Reinink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Postgres specific database features
1 parent
b62838e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
app/Contact.php
app/Organization.php
app/User.php
app/Contact.php
View file @
710326e
...
@@ -27,11 +27,11 @@ class Contact extends Model
...
@@ -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'
,
'
i
like'
,
'%'
.
$search
.
'%'
)
$query
->
where
(
'first_name'
,
'like'
,
'%'
.
$search
.
'%'
)
->
orWhere
(
'last_name'
,
'
i
like'
,
'%'
.
$search
.
'%'
)
->
orWhere
(
'last_name'
,
'like'
,
'%'
.
$search
.
'%'
)
->
orWhere
(
'email'
,
'
i
like'
,
'%'
.
$search
.
'%'
)
->
orWhere
(
'email'
,
'like'
,
'%'
.
$search
.
'%'
)
->
orWhereHas
(
'organization'
,
function
(
$query
)
use
(
$search
)
{
->
orWhereHas
(
'organization'
,
function
(
$query
)
use
(
$search
)
{
$query
->
where
(
'name'
,
'
i
like'
,
'%'
.
$search
.
'%'
);
$query
->
where
(
'name'
,
'like'
,
'%'
.
$search
.
'%'
);
});
});
});
});
})
->
when
(
$filters
[
'trashed'
]
??
null
,
function
(
$query
,
$trashed
)
{
})
->
when
(
$filters
[
'trashed'
]
??
null
,
function
(
$query
,
$trashed
)
{
...
...
app/Organization.php
View file @
710326e
...
@@ -16,7 +16,7 @@ class Organization extends Model
...
@@ -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'
,
'
i
like'
,
'%'
.
$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
();
...
...
app/User.php
View file @
710326e
...
@@ -45,9 +45,9 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
...
@@ -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'
,
'
i
like'
,
'%'
.
$search
.
'%'
)
$query
->
where
(
'first_name'
,
'like'
,
'%'
.
$search
.
'%'
)
->
orWhere
(
'last_name'
,
'
i
like'
,
'%'
.
$search
.
'%'
)
->
orWhere
(
'last_name'
,
'like'
,
'%'
.
$search
.
'%'
)
->
orWhere
(
'email'
,
'
i
like'
,
'%'
.
$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
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment