diff --git a/app/views/dashboard/components/add.blade.php b/app/views/dashboard/components/add.blade.php index 00ae977c..a6562d7f 100644 --- a/app/views/dashboard/components/add.blade.php +++ b/app/views/dashboard/components/add.blade.php @@ -57,7 +57,6 @@ -
diff --git a/app/views/dashboard/incidents/add.blade.php b/app/views/dashboard/incidents/add.blade.php index 44a445c6..fe6754dc 100644 --- a/app/views/dashboard/incidents/add.blade.php +++ b/app/views/dashboard/incidents/add.blade.php @@ -89,8 +89,6 @@
- -
diff --git a/app/views/dashboard/incidents/edit.blade.php b/app/views/dashboard/incidents/edit.blade.php index 94501107..1ab7f621 100644 --- a/app/views/dashboard/incidents/edit.blade.php +++ b/app/views/dashboard/incidents/edit.blade.php @@ -78,7 +78,6 @@
- id}}>
diff --git a/app/views/dashboard/schedule/add.blade.php b/app/views/dashboard/schedule/add.blade.php index 3c81bedb..6dd53434 100644 --- a/app/views/dashboard/schedule/add.blade.php +++ b/app/views/dashboard/schedule/add.blade.php @@ -44,8 +44,6 @@
- -
diff --git a/app/views/dashboard/schedule/edit.blade.php b/app/views/dashboard/schedule/edit.blade.php index 2e5da716..3fb56c1e 100644 --- a/app/views/dashboard/schedule/edit.blade.php +++ b/app/views/dashboard/schedule/edit.blade.php @@ -44,8 +44,6 @@
- -
diff --git a/src/Http/Controllers/DashComponentController.php b/src/Http/Controllers/DashComponentController.php index be08db91..c8474ac3 100644 --- a/src/Http/Controllers/DashComponentController.php +++ b/src/Http/Controllers/DashComponentController.php @@ -7,6 +7,7 @@ use CachetHQ\Cachet\Models\ComponentGroup; use CachetHQ\Cachet\Models\Tag; use GrahamCampbell\Binput\Facades\Binput; use Illuminate\Routing\Controller; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\View; @@ -105,7 +106,9 @@ class DashComponentController extends Controller public function updateComponentAction(Component $component) { $_component = Binput::get('component'); + $_component['user_id'] = Auth::user()->id; $tags = array_pull($_component, 'tags'); + $component->update($_component); if (! $component->isValid()) { @@ -172,6 +175,7 @@ class DashComponentController extends Controller public function createComponentAction() { $_component = Binput::get('component'); + $_component['user_id'] = Auth::user()->id; // We deal with tags separately. $tags = array_pull($_component, 'tags'); diff --git a/src/Http/Controllers/DashIncidentController.php b/src/Http/Controllers/DashIncidentController.php index 7fbbbb69..73be8236 100644 --- a/src/Http/Controllers/DashIncidentController.php +++ b/src/Http/Controllers/DashIncidentController.php @@ -7,6 +7,7 @@ use CachetHQ\Cachet\Models\Incident; use CachetHQ\Cachet\Models\IncidentTemplate; use GrahamCampbell\Binput\Facades\Binput; use Illuminate\Routing\Controller; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\View; @@ -95,7 +96,9 @@ class DashIncidentController extends Controller public function createIncidentAction() { $incidentData = Binput::get('incident'); + $incidentData['user_id'] = Auth::user()->id; $componentStatus = array_pull($incidentData, 'component_status'); + $incident = Incident::create($incidentData); if (! $incident->isValid()) { @@ -261,8 +264,9 @@ class DashIncidentController extends Controller */ public function editIncidentAction(Incident $incident) { - $_incident = Binput::get('incident'); - $incident->update($_incident); + $incidentData = Binput::get('incident'); + $incidentData['user_id'] = Auth::user()->id; + $incident->update($incidentData); if (! $incident->isValid()) { segment_track('Dashboard', [ diff --git a/src/Http/Controllers/DashScheduleController.php b/src/Http/Controllers/DashScheduleController.php index c4f5c82c..ce57c2e7 100644 --- a/src/Http/Controllers/DashScheduleController.php +++ b/src/Http/Controllers/DashScheduleController.php @@ -7,6 +7,7 @@ use CachetHQ\Cachet\Models\IncidentTemplate; use Carbon\Carbon; use GrahamCampbell\Binput\Facades\Binput; use Illuminate\Routing\Controller; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\View; use Illuminate\Support\MessageBag; @@ -81,6 +82,7 @@ class DashScheduleController extends Controller public function addScheduleAction() { $scheduleData = Binput::get('incident'); + $scheduleData['user_id'] = Auth::user()->id; // Parse the schedule date. $scheduledAt = Carbon::createFromFormat('d/m/Y H:i', $scheduleData['scheduled_at']); @@ -155,6 +157,7 @@ class DashScheduleController extends Controller public function editScheduleAction(Incident $schedule) { $scheduleData = Binput::get('incident'); + $scheduleData['user_id'] = Auth::user()->id // Parse the schedule date. $scheduledAt = Carbon::createFromFormat('d/m/Y H:i', $scheduleData['scheduled_at']);