Use the new dispatch helper function

This commit is contained in:
Graham Campbell
2015-12-24 15:16:09 +00:00
parent 98795c8220
commit 5557edc342
15 changed files with 41 additions and 86 deletions
@@ -20,15 +20,12 @@ use CachetHQ\Cachet\Models\ComponentGroup;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\IncidentTemplate;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
class IncidentController extends Controller
{
use DispatchesJobs;
/**
* Stores the sub-sidebar tree list.
*
@@ -110,7 +107,7 @@ class IncidentController extends Controller
public function createIncidentAction()
{
try {
$incident = $this->dispatch(new ReportIncidentCommand(
$incident = dispatch(new ReportIncidentCommand(
Binput::get('name'),
Binput::get('status'),
Binput::get('message'),
@@ -202,7 +199,7 @@ class IncidentController extends Controller
*/
public function deleteIncidentAction(Incident $incident)
{
$this->dispatch(new RemoveIncidentCommand($incident));
dispatch(new RemoveIncidentCommand($incident));
return Redirect::route('dashboard.incidents.index')
->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.delete.success')));
@@ -234,7 +231,7 @@ class IncidentController extends Controller
public function editIncidentAction(Incident $incident)
{
try {
$incident = $this->dispatch(new UpdateIncidentCommand(
$incident = dispatch(new UpdateIncidentCommand(
$incident,
Binput::get('name'),
Binput::get('status'),