Skip to content

Commit

Permalink
Merge pull request #1193 from avsdev-cw/patch-2
Browse files Browse the repository at this point in the history
Fix PHP7.4+ compatibility
  • Loading branch information
lcharette authored Feb 12, 2022
2 parents 3239bc1 + 4609904 commit f09acca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/sprinkles/core/src/Database/Models/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public static function findUnique($value, $identifier, $checkDeleted = true)
{
$query = static::whereRaw("LOWER($identifier) = ?", [mb_strtolower($value)]);

if ($checkDeleted && method_exists($query, 'withTrashed')) {
$query = $query->withTrashed();
if ($checkDeleted && $query->hasMacro('withTrashed')) {
$query = $query->withTrashed();
}

return $query->first();
Expand Down

0 comments on commit f09acca

Please sign in to comment.