app/Http/Controllers/APIProductController.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)
    {
        $product = Product::create($request->all());
        return response()->json(['data' => $product], 201);
    }
public function store ( Request $ request ) { $ product = Product :: create ( $ request -> all ( ) ) ; return response ( ) -> json ( [ 'data' => $ product ] , 201 ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .