app/Http/Controllers/Admin/enquiryresponseController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $data = $request->validate(
            [
                'responded_through' => 'required',
                'message' => 'required',
            ]
        );
        $enquiryresponse = new EnquiryResponse([
            'enquiry_by' => $request->enquiry_by,
            'responded_by' => $request->responded_by,
            'responded_through' => $request->responded_through,
            'message' => $request->message,
            'remarks'=>$request->remarks           
        ]);
        $data = $enquiryresponse->save();
        if ($data) {
            return redirect()->route('enquiryresponse.index')->with('success', 'New enquiry response added');
        } else {
            return redirect()->route('enquiryresponse.index')->with('error', 'Sorry! there is an error adding  enquiry response');
        }
    }
public function store ( Request $ request ) { $ data = $ request -> validate ( [ 'responded_through' => 'required' , 'message' => 'required' , ] ) ; $ enquiryresponse = new EnquiryResponse ( [ 'enquiry_by' => $ request -> enquiry_by , 'responded_by' => $ request -> responded_by , 'responded_through' => $ request -> responded_through , 'message' => $ request -> message , 'remarks' => $ request -> remarks ] ) ; $ data = $ enquiryresponse -> save ( ) ; if ( $ data ) { return redirect ( ) -> route ( 'enquiryresponse.index' ) -> with ( 'success' , 'New enquiry response added' ) ; } else { return redirect ( ) -> route ( 'enquiryresponse.index' ) -> with ( 'error' , 'Sorry! there is an error adding  enquiry response' ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .