23
23
use GrahamCampbell \Binput \Facades \Binput ;
24
24
use Illuminate \Contracts \Auth \Guard ;
25
25
use Illuminate \Routing \Controller ;
26
- use Illuminate \Support \Facades \Redirect ;
27
26
use Illuminate \Support \Facades \View ;
28
27
29
28
/**
@@ -61,13 +60,13 @@ public function __construct(Guard $auth)
61
60
$ this ->subMenu = [
62
61
'incidents ' => [
63
62
'title ' => trans ('dashboard.incidents.incidents ' ),
64
- 'url ' => route ('dashboard.incidents.index ' ),
63
+ 'url ' => cachet_route ('dashboard.incidents ' ),
65
64
'icon ' => 'ion-android-checkmark-circle ' ,
66
65
'active ' => true ,
67
66
],
68
67
'schedule ' => [
69
68
'title ' => trans ('dashboard.schedule.schedule ' ),
70
- 'url ' => route ('dashboard.schedule.index ' ),
69
+ 'url ' => cachet_route ('dashboard.schedule ' ),
71
70
'icon ' => 'ion-android-calendar ' ,
72
71
'active ' => false ,
73
72
],
@@ -139,13 +138,13 @@ public function createIncidentAction()
139
138
null
140
139
));
141
140
} catch (ValidationException $ e ) {
142
- return Redirect:: route ('dashboard.incidents.add ' )
141
+ return cachet_route ('dashboard.incidents.create ' )
143
142
->withInput (Binput::all ())
144
143
->withTitle (sprintf ('%s %s ' , trans ('dashboard.notifications.whoops ' ), trans ('dashboard.incidents.add.failure ' )))
145
144
->withErrors ($ e ->getMessageBag ());
146
145
}
147
146
148
- return Redirect:: route ('dashboard.incidents.index ' )
147
+ return cachet_route ('dashboard.incidents ' )
149
148
->withSuccess (sprintf ('%s %s ' , trans ('dashboard.notifications.awesome ' ), trans ('dashboard.incidents.add.success ' )));
150
149
}
151
150
@@ -185,7 +184,7 @@ public function deleteTemplateAction(IncidentTemplate $template)
185
184
{
186
185
$ template ->delete ();
187
186
188
- return Redirect:: route ('dashboard.templates.index ' )
187
+ return cachet_route ('dashboard.templates ' )
189
188
->withSuccess (sprintf ('%s %s ' , trans ('dashboard.notifications.awesome ' ), trans ('dashboard.incidents.templates.delete.success ' )));
190
189
}
191
190
@@ -199,13 +198,13 @@ public function createIncidentTemplateAction()
199
198
try {
200
199
IncidentTemplate::create (Binput::get ('template ' ));
201
200
} catch (ValidationException $ e ) {
202
- return Redirect:: route ('dashboard.templates.add ' )
201
+ return cachet_route ('dashboard.templates.create ' )
203
202
->withInput (Binput::all ())
204
203
->withTitle (sprintf ('%s %s ' , trans ('dashboard.notifications.whoops ' ), trans ('dashboard.incidents.templates.add.failure ' )))
205
204
->withErrors ($ e ->getMessageBag ());
206
205
}
207
206
208
- return Redirect:: route ('dashboard.templates.index ' )
207
+ return cachet_route ('dashboard.templates ' )
209
208
->withSuccess (sprintf ('%s %s ' , trans ('dashboard.notifications.awesome ' ), trans ('dashboard.incidents.templates.add.success ' )));
210
209
}
211
210
@@ -220,7 +219,7 @@ public function deleteIncidentAction(Incident $incident)
220
219
{
221
220
dispatch (new RemoveIncidentCommand ($ incident ));
222
221
223
- return Redirect:: route ('dashboard.incidents.index ' )
222
+ return cachet_route ('dashboard.incidents ' )
224
223
->withSuccess (sprintf ('%s %s ' , trans ('dashboard.notifications.awesome ' ), trans ('dashboard.incidents.delete.success ' )));
225
224
}
226
225
@@ -265,7 +264,7 @@ public function editIncidentAction(Incident $incident)
265
264
null
266
265
));
267
266
} catch (ValidationException $ e ) {
268
- return Redirect:: route ('dashboard.incidents.edit ' , ['id ' => $ incident ->id ])
267
+ return cachet_route ('dashboard.incidents.edit ' , ['id ' => $ incident ->id ])
269
268
->withInput (Binput::all ())
270
269
->withTitle (sprintf ('%s %s ' , trans ('dashboard.notifications.whoops ' ), trans ('dashboard.incidents.templates.edit.failure ' )))
271
270
->withErrors ($ e ->getMessageBag ());
@@ -275,7 +274,7 @@ public function editIncidentAction(Incident $incident)
275
274
$ incident ->component ->update (['status ' => Binput::get ('component_status ' )]);
276
275
}
277
276
278
- return Redirect:: route ('dashboard.incidents.edit ' , ['id ' => $ incident ->id ])
277
+ return cachet_route ('dashboard.incidents.edit ' , ['id ' => $ incident ->id ])
279
278
->withSuccess (sprintf ('%s %s ' , trans ('dashboard.notifications.awesome ' ), trans ('dashboard.incidents.edit.success ' )));
280
279
}
281
280
@@ -291,12 +290,12 @@ public function editTemplateAction(IncidentTemplate $template)
291
290
try {
292
291
$ template ->update (Binput::get ('template ' ));
293
292
} catch (ValidationException $ e ) {
294
- return Redirect:: route ('dashboard.templates.edit ' , ['id ' => $ template ->id ])
293
+ return cachet_route ('dashboard.templates.edit ' , ['id ' => $ template ->id ])
295
294
->withUpdatedTemplate ($ template )
296
295
->withTemplateErrors ($ e ->getMessageBag ()->getErrors ());
297
296
}
298
297
299
- return Redirect:: route ('dashboard.templates.edit ' , ['id ' => $ template ->id ])
298
+ return cachet_route ('dashboard.templates.edit ' , ['id ' => $ template ->id ])
300
299
->withUpdatedTemplate ($ template );
301
300
}
302
301
@@ -329,13 +328,13 @@ public function createIncidentUpdateAction(Incident $incident)
329
328
$ this ->auth ->user ()
330
329
));
331
330
} catch (ValidationException $ e ) {
332
- return Redirect:: route ('dashboard.incidents.update ' , ['id ' => $ incident ->id ])
331
+ return cachet_route ('dashboard.incidents.update ' , ['id ' => $ incident ->id ])
333
332
->withInput (Binput::all ())
334
333
->withTitle (sprintf ('%s %s ' , trans ('dashboard.notifications.whoops ' ), trans ('dashboard.incidents.templates.edit.failure ' )))
335
334
->withErrors ($ e ->getMessageBag ());
336
335
}
337
336
338
- return Redirect:: route ('dashboard.incidents.index ' )
337
+ return cachet_route ('dashboard.incidents ' )
339
338
->withSuccess (sprintf ('%s %s ' , trans ('dashboard.notifications.awesome ' ), trans ('dashboard.incidents.delete.success ' )));
340
339
}
341
340
}
0 commit comments