app/Http/Controllers/ContactController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create(Request $request)
    {
        $contacts = new Contact([
            'name' => $request->input('name'),
            'email' => $request->input('email'),
            'phone' => $request->input('phone'),
            'message' => $request->input('message')
        ]);
        $contacts->save();
        return response()->json('The book successfully added');
    }
public function create ( Request $ request ) { $ contacts = new Contact ( [ 'name' => $ request -> input ( 'name' ) , 'email' => $ request -> input ( 'email' ) , 'phone' => $ request -> input ( 'phone' ) , 'message' => $ request -> input ( 'message' ) ] ) ; $ contacts -> save ( ) ; return response ( ) -> json ( 'The book successfully added' ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .
// replace book with contacts and Book with Contact