From 6bbdd864e744942379648fa508c359e0448b530f Mon Sep 17 00:00:00 2001 From: James Brooks Date: Mon, 2 Mar 2015 21:15:12 +0000 Subject: [PATCH] Use Eloquent syntax --- src/Models/Incident.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Models/Incident.php b/src/Models/Incident.php index e227ab04..1725e3c8 100644 --- a/src/Models/Incident.php +++ b/src/Models/Incident.php @@ -72,7 +72,7 @@ class Incident extends Model implements TransformableInterface, PresenterInterfa { $timestamp = (new Date())->setTimezone(SettingFacade::get('app_timezone'))->format('Y-m-d H:i:s'); - return $query->where('status', 0)->whereRaw('scheduled_at >= "'.$timestamp.'"'); + return $query->where('status', 0)->where('scheduled_at', '>=', $timestamp); } /** @@ -87,7 +87,7 @@ class Incident extends Model implements TransformableInterface, PresenterInterfa return $query->where(function ($query) { $timestamp = (new Date())->setTimezone(SettingFacade::get('app_timezone'))->format('Y-m-d H:i:s'); - return $query->whereNull('scheduled_at')->orWhereRaw('scheduled_at <= "'.$timestamp.'"'); + return $query->whereNull('scheduled_at')->orWhere('scheduled_at', '<=', $timestamp); }); }