app/Http/Controllers/CommunicationEquipmentController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\CommunicationEquipment  $communicationEquipment
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(CommunicationEquipmentRequest $request, CommunicationEquipment $equipment)
    {
        $this->validate($request, [
            'serial_number' => 'required',
            'unitcode' => 'required',
            'status' => 'required',
            'specification' => 'required',
            'nomenclature_id' => 'required',
        ]);
        $equipment = CommunicationEquipment::find($equipment->id);
        $equipment->serial_number = $request->input('serial_number');
        $equipment->unitcode = $request->input('unitcode');
        $equipment->status = $request->input('status');
        $equipment->specification = $request->input('specification');
        $equipment->remarks = $request->input('remarks');
        $equipment->date_acquired = $request->input('date_acquired');
        $equipment->cost_acquired = $request->input('cost_acquired');
        $equipment->nomenclature_id = $request->input('nomenclature_id');
        $equipment->save();
        return redirect()->route('c4s equipment')->withStatus(__('Equipment Successfully Updated.'));
    }
public function update ( CommunicationEquipmentRequest $ request , CommunicationEquipment $ equipment ) { $ this -> validate ( $ request , [ 'serial_number' => 'required' , 'unitcode' => 'required' , 'status' => 'required' , 'specification' => 'required' , 'nomenclature_id' => 'required' , ] ) ; $ equipment = CommunicationEquipment :: find ( $ equipment -> id ) ; $ equipment -> serial_number = $ request -> input ( 'serial_number' ) ; $ equipment -> unitcode = $ request -> input ( 'unitcode' ) ; $ equipment -> status = $ request -> input ( 'status' ) ; $ equipment -> specification = $ request -> input ( 'specification' ) ; $ equipment -> remarks = $ request -> input ( 'remarks' ) ; $ equipment -> date_acquired = $ request -> input ( 'date_acquired' ) ; $ equipment -> cost_acquired = $ request -> input ( 'cost_acquired' ) ; $ equipment -> nomenclature_id = $ request -> input ( 'nomenclature_id' ) ; $ equipment -> save ( ) ; return redirect ( ) -> route ( 'c4s equipment' ) -> withStatus ( __ ( 'Equipment Successfully Updated.' ) ) ; }
Update the specified resource in storage.
Update the specified resource in storage .