Check where consistency
This commit is contained in:
@@ -63,7 +63,7 @@ class ReportIncidentCommandHandler
|
||||
'stickied' => $command->stickied,
|
||||
];
|
||||
|
||||
if ($template = IncidentTemplate::where('slug', $command->template)->first()) {
|
||||
if ($template = IncidentTemplate::where('slug', '=', $command->template)->first()) {
|
||||
$data['message'] = $this->parseTemplate($template, $command);
|
||||
} else {
|
||||
$data['message'] = $command->message;
|
||||
|
||||
@@ -56,7 +56,7 @@ class UpdateIncidentCommandHandler
|
||||
*/
|
||||
public function handle(UpdateIncidentCommand $command)
|
||||
{
|
||||
if ($template = IncidentTemplate::where('slug', $command->template)->first()) {
|
||||
if ($template = IncidentTemplate::where('slug', '=', $command->template)->first()) {
|
||||
$command->message = $this->parseTemplate($template, $command);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class AddMetricPointCommandHandler
|
||||
protected function findOrCreatePoint(AddMetricPointCommand $command)
|
||||
{
|
||||
$buffer = Carbon::now()->subMinutes($command->metric->threshold);
|
||||
$point = MetricPoint::where('metric_id', $command->metric->id)->where('value', $command->value)->where('created_at', '>=', $buffer)->first();
|
||||
$point = MetricPoint::where('metric_id', '=', $command->metric->id)->where('value', '=', $command->value)->where('created_at', '>=', $buffer)->first();
|
||||
|
||||
if ($point) {
|
||||
return $point;
|
||||
|
||||
@@ -36,7 +36,7 @@ class SubscribeSubscriberCommandHandler
|
||||
*/
|
||||
public function handle(SubscribeSubscriberCommand $command)
|
||||
{
|
||||
if ($subscriber = Subscriber::where('email', $command->email)->first()) {
|
||||
if ($subscriber = Subscriber::where('email', '=', $command->email)->first()) {
|
||||
return $subscriber;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvi
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event handler mappings for the application.
|
||||
* The event listener mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
|
||||
@@ -119,7 +119,7 @@ class ApiController extends AbstractApiController
|
||||
{
|
||||
$templateSlug = Binput::get('slug');
|
||||
|
||||
if ($template = IncidentTemplate::where('slug', $templateSlug)->first()) {
|
||||
if ($template = IncidentTemplate::where('slug', '=', $templateSlug)->first()) {
|
||||
return $template;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ class IncidentController extends Controller
|
||||
return View::make('dashboard.incidents.add')
|
||||
->withPageTitle(trans('dashboard.incidents.add.title').' - '.trans('dashboard.dashboard'))
|
||||
->withComponentsInGroups(ComponentGroup::with('components')->get())
|
||||
->withComponentsOutGroups(Component::where('group_id', 0)->get())
|
||||
->withComponentsOutGroups(Component::where('group_id', '=', 0)->get())
|
||||
->withIncidentTemplates(IncidentTemplate::all());
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ class IncidentController extends Controller
|
||||
->withPageTitle(trans('dashboard.incidents.edit.title').' - '.trans('dashboard.dashboard'))
|
||||
->withIncident($incident)
|
||||
->withComponentsInGroups(ComponentGroup::with('components')->get())
|
||||
->withComponentsOutGroups(Component::where('group_id', 0)->get());
|
||||
->withComponentsOutGroups(Component::where('group_id', '=', 0)->get());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -200,7 +200,7 @@ class SettingsController extends Controller
|
||||
{
|
||||
$this->subMenu['security']['active'] = true;
|
||||
|
||||
$unsecureUsers = User::whereNull('google_2fa_secret')->orWhere('google_2fa_secret', '')->get();
|
||||
$unsecureUsers = User::whereNull('google_2fa_secret')->orWhere('google_2fa_secret', '=', '')->get();
|
||||
|
||||
Session::flash('redirect_to', $this->subMenu['security']['url']);
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ class SubscribeController extends Controller
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
$subscriber = Subscriber::where('verify_code', $code)->first();
|
||||
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
|
||||
|
||||
if (!$subscriber) {
|
||||
throw new BadRequestHttpException();
|
||||
@@ -149,7 +149,7 @@ class SubscribeController extends Controller
|
||||
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
|
||||
$usedComponentGroups = Component::enabled()->where('group_id', '>', 0)->groupBy('group_id')->pluck('group_id');
|
||||
$componentGroups = ComponentGroup::whereIn('id', $usedComponentGroups)->orderBy('order')->get();
|
||||
$ungroupedComponents = Component::enabled()->where('group_id', 0)->orderBy('order')->orderBy('created_at')->get();
|
||||
$ungroupedComponents = Component::enabled()->where('group_id', '=', 0)->orderBy('order')->orderBy('created_at')->get();
|
||||
|
||||
if (!$subscriber) {
|
||||
throw new BadRequestHttpException();
|
||||
|
||||
@@ -269,8 +269,6 @@ class IncidentPresenter extends BasePresenter implements Arrayable
|
||||
public function duration()
|
||||
{
|
||||
if ($update = $this->latest()) {
|
||||
dd($update->created_at->diffInSeconds($this->wrappedObject->created_at));
|
||||
|
||||
return $this->wrappedObject->created_at->diffInSeconds($update->created_at);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class Repository
|
||||
$this->stale = true;
|
||||
|
||||
if ($value === null) {
|
||||
$this->model->where('name', $name)->delete();
|
||||
$this->model->where('name', '=', $name)->delete();
|
||||
} else {
|
||||
$this->model->updateOrCreate(compact('name'), compact('value'));
|
||||
}
|
||||
@@ -97,7 +97,7 @@ class Repository
|
||||
*/
|
||||
public function get($name, $default = null)
|
||||
{
|
||||
if ($setting = $this->model->where('name', $name)->first()) {
|
||||
if ($setting = $this->model->where('name', '=', $name)->first()) {
|
||||
return $this->castSetting($name, $setting->value);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class Repository
|
||||
{
|
||||
$this->stale = true;
|
||||
|
||||
$this->model->where('name', $name)->delete();
|
||||
$this->model->where('name', '=', $name)->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user