app/Http/Controllers/Admin/enquiryresponseController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(EnquiryResponseValidator $request, $id)
    {
        $data = $request->validate(
            [
                'name' => 'required|string',
                'description' => ''
            ]
        );
        $enquiryresponse = EnquiryResponse::findorfail($id);
        $enquiryresponse->fill($data);
        $success = $enquiryresponse->save();
        if ($success) {
            return redirect()->route('enquiryresponse.index')->with('success', 'New enquiry response updated');
        } else {
            return redirect()->route('enquiryresponse.index')->with('error', 'Sorry! there is an error updating  enquiry response');
        }
    }
public function update ( EnquiryResponseValidator $ request , $ id ) { $ data = $ request -> validate ( [ 'name' => 'required|string' , 'description' => '' ] ) ; $ enquiryresponse = EnquiryResponse :: findorfail ( $ id ) ; $ enquiryresponse -> fill ( $ data ) ; $ success = $ enquiryresponse -> save ( ) ; if ( $ success ) { return redirect ( ) -> route ( 'enquiryresponse.index' ) -> with ( 'success' , 'New enquiry response updated' ) ; } else { return redirect ( ) -> route ( 'enquiryresponse.index' ) -> with ( 'error' , 'Sorry! there is an error updating  enquiry response' ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .