diff --git a/app/Http/Controllers/Dashboard/IncidentController.php b/app/Http/Controllers/Dashboard/IncidentController.php index 0b9e9758..94494386 100644 --- a/app/Http/Controllers/Dashboard/IncidentController.php +++ b/app/Http/Controllers/Dashboard/IncidentController.php @@ -297,9 +297,7 @@ class IncidentController extends Controller */ public function showIncidentUpdates(Incident $incident) { - $updates = IncidentUpdate::byIncident($incident)->orderBy('created_at', 'desc')->get(); - - return View::make('dashboard.incidents.updates.index')->withIncident($incident)->withUpdates($updates); + return View::make('dashboard.incidents.updates.index')->withIncident($incident); } /** diff --git a/app/Models/IncidentUpdate.php b/app/Models/IncidentUpdate.php index 2a8bc194..c266d057 100644 --- a/app/Models/IncidentUpdate.php +++ b/app/Models/IncidentUpdate.php @@ -74,19 +74,6 @@ class IncidentUpdate extends Model implements HasPresenter 'user_id', ]; - /** - * Scope all by incident. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \CachetHQ\Cachet\Models\Incident $incident - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public function scopeByIncident(Builder $query, Incident $incident) - { - return $query->where('incident_id', '=', $incident->id); - } - /** * Get the incident relation. * diff --git a/resources/views/dashboard/incidents/updates/index.blade.php b/resources/views/dashboard/incidents/updates/index.blade.php index 5d0a41fa..cbc58b34 100644 --- a/resources/views/dashboard/incidents/updates/index.blade.php +++ b/resources/views/dashboard/incidents/updates/index.blade.php @@ -22,7 +22,7 @@ @include('dashboard.partials.errors')
- @foreach($updates as $update) + @foreach($incident->updates as $update)
{{ Str::words($update->message, 8) }}