public function destroy($workRequestId, $updateId)
    {
        $workRequest = $this->workRequest->find($workRequestId);

        if ($this->update->destroy($updateId)) {
            $this->message = 'Successfully deleted update';
            $this->messageType = 'success';
            $this->redirect = route('maintenance.work-requests.show', [$workRequest->id, '#tab_updates']);
        } else {
            $this->message = 'There was an error trying to delete this update. Please try again.';
            $this->messageType = 'danger';
            $this->redirect = route('maintenance.work-requests.show', [$workRequest->id, '#tab_updates']);
        }

        return $this->response();
    }
public function destroy($workRequestId, $updateId)
    {
        $workRequest = $this->workRequest->find($workRequestId);

        if ($this->update->destroy($updateId)) {
            $this->message = 'Successfully deleted update';
            $this->messageType = 'success';
            $this->redirect = route('maintenance.work-requests.show', [$workRequest->id, '#tab_updates']);
        } else {
            $this->message = 'There was an error trying to delete this update. Please try again.';
            $this->messageType = 'danger';
            $this->redirect = route('maintenance.work-requests.show', [$workRequest->id, '#tab_updates']);
        }

        return $this->response();
    }
public function destroy ( $ workRequestId , $ updateId ) { $ workRequest = $ this -> workRequest -> find ( $ workRequestId ) ; if ( $ this -> update -> destroy ( $ updateId ) ) { $ this -> message = 'Successfully deleted update' ; $ this -> messageType = 'success' ; $ this -> redirect = route ( 'maintenance.work-requests.show' , [ $ workRequest -> id , '#tab_updates' ] ) ; } else { $ this -> message = 'There was an error trying to delete this update. Please try again.' ; $ this -> messageType = 'danger' ; $ this -> redirect = route ( 'maintenance.work-requests.show' , [ $ workRequest -> id , '#tab_updates' ] ) ; } return $ this -> response ( ) ; }
Processes deleting a work order update.

@param $workRequestId
@param $updateId

@return \Illuminate\Http\JsonResponse|mixed
Processes deleting a work order update .