app/Http/Controllers/ProductController.php
// create function allow ass to create new product
create function allow ass to create new product
create function allow ass to create new product
public function create(Request $request){
        $product = new Product();
        $product->name = $request->name;
        $product->price = $request->price;
        $product->description = $request->description;
        $product->save();
        return response()->json($product);
    }
public function create ( Request $ request ) { $ product = new Product ( ) ; $ product -> name = $ request -> name ; $ product -> price = $ request -> price ; $ product -> description = $ request -> description ; $ product -> save ( ) ; return response ( ) -> json ( $ product ) ; }
create function allow ass to create new product
create function allow ass to create new product
// call the save function to save the product to the database