public function store($workRequestId)
    {
        if ($this->updateValidator->passes()) {
            $workRequest = $this->workRequest->find($workRequestId);

            $update = $this->update->setInput($this->inputAll())->create();

            $this->workRequest->saveUpdate($workRequest, $update);

            $this->message = 'Successfully added update';
            $this->messageType = 'success';
            $this->redirect = routeBack('maintenance.work-requests.show', [$workRequest->id]);
        } else {
            $this->errors = $this->updateValidator->getErrors();
            $this->redirect = routeBack('maintenance.work-requests.show', [$workRequestId]);
        }

        return $this->response();
    }
public function store($workRequestId)
    {
        if ($this->updateValidator->passes()) {
            $workRequest = $this->workRequest->find($workRequestId);

            $update = $this->update->setInput($this->inputAll())->create();

            $this->workRequest->saveUpdate($workRequest, $update);

            $this->message = 'Successfully added update';
            $this->messageType = 'success';
            $this->redirect = routeBack('maintenance.work-requests.show', [$workRequest->id]);
        } else {
            $this->errors = $this->updateValidator->getErrors();
            $this->redirect = routeBack('maintenance.work-requests.show', [$workRequestId]);
        }

        return $this->response();
    }
public function store ( $ workRequestId ) { if ( $ this -> updateValidator -> passes ( ) ) { $ workRequest = $ this -> workRequest -> find ( $ workRequestId ) ; $ update = $ this -> update -> setInput ( $ this -> inputAll ( ) ) -> create ( ) ; $ this -> workRequest -> saveUpdate ( $ workRequest , $ update ) ; $ this -> message = 'Successfully added update' ; $ this -> messageType = 'success' ; $ this -> redirect = routeBack ( 'maintenance.work-requests.show' , [ $ workRequest -> id ] ) ; } else { $ this -> errors = $ this -> updateValidator -> getErrors ( ) ; $ this -> redirect = routeBack ( 'maintenance.work-requests.show' , [ $ workRequestId ] ) ; } return $ this -> response ( ) ; }
Creates a new work order customer update.

@param int $workRequestId

@return mixed
Creates a new work order customer update .