public function store($workOrderId)
    {
        if ($this->workOrderNotificationValidator->passes()) {
            $workOrder = $this->workOrder->find($workOrderId);

            $data = $this->inputAll();
            $data['work_order_id'] = $workOrder->id;

            $this->workOrderNotification->setInput($data)->create();

            $this->message = 'Successfully updated notifications';
            $this->messageType = 'success';
            $this->redirect = route('maintenance.work-orders.show', [$workOrder->id]);
        } else {
            $this->errors = $this->workOrderNotificationValidator->getErrors();
            $this->redirect = route('maintenance.work-orders.show', [$workOrderId]);
        }

        return $this->response();
    }
public function store($workOrderId)
    {
        if ($this->workOrderNotificationValidator->passes()) {
            $workOrder = $this->workOrder->find($workOrderId);

            $data = $this->inputAll();
            $data['work_order_id'] = $workOrder->id;

            $this->workOrderNotification->setInput($data)->create();

            $this->message = 'Successfully updated notifications';
            $this->messageType = 'success';
            $this->redirect = route('maintenance.work-orders.show', [$workOrder->id]);
        } else {
            $this->errors = $this->workOrderNotificationValidator->getErrors();
            $this->redirect = route('maintenance.work-orders.show', [$workOrderId]);
        }

        return $this->response();
    }
public function store ( $ workOrderId ) { if ( $ this -> workOrderNotificationValidator -> passes ( ) ) { $ workOrder = $ this -> workOrder -> find ( $ workOrderId ) ; $ data = $ this -> inputAll ( ) ; $ data [ 'work_order_id' ] = $ workOrder -> id ; $ this -> workOrderNotification -> setInput ( $ data ) -> create ( ) ; $ this -> message = 'Successfully updated notifications' ; $ this -> messageType = 'success' ; $ this -> redirect = route ( 'maintenance.work-orders.show' , [ $ workOrder -> id ] ) ; } else { $ this -> errors = $ this -> workOrderNotificationValidator -> getErrors ( ) ; $ this -> redirect = route ( 'maintenance.work-orders.show' , [ $ workOrderId ] ) ; } return $ this -> response ( ) ; }
Creates a new notification for the specified work order.

@param string|int $workOrderId

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
Creates a new notification for the specified work order .