app/Http/Controllers/Admin/enquiryController.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(EnquiryValidator $request)
    {
        $data = $request->validate(
            [
                'iscustomer' => '',
                'customerid' => '',
                'name' => '',
                'email' => '',
                'phone' => '',
                'endate' => 'required|date',
                'entime' => 'required',
                'category' => 'required',
                'source' => 'required',
                'remarks' => ''
            ]
        );
        $enquiry = new Enquiry();
        $enquiry->fill($data);
        $success = $enquiry->save();
        if ($success) {
            return redirect()->route('enquiry.index')->with('success', 'New enquiry added');
        } else {
            return redirect()->route('enquiry.index')->with('error', 'Sorry! there is an error adding  enquiry enquiry');
        }
    }
public function store ( EnquiryValidator $ request ) { $ data = $ request -> validate ( [ 'iscustomer' => '' , 'customerid' => '' , 'name' => '' , 'email' => '' , 'phone' => '' , 'endate' => 'required|date' , 'entime' => 'required' , 'category' => 'required' , 'source' => 'required' , 'remarks' => '' ] ) ; $ enquiry = new Enquiry ( ) ; $ enquiry -> fill ( $ data ) ; $ success = $ enquiry -> save ( ) ; if ( $ success ) { return redirect ( ) -> route ( 'enquiry.index' ) -> with ( 'success' , 'New enquiry added' ) ; } else { return redirect ( ) -> route ( 'enquiry.index' ) -> with ( 'error' , 'Sorry! there is an error adding  enquiry enquiry' ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .