app/Http/Controllers/ProductController.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(ProductRequest $request)
    {
        $product = new Product;
        $types =  ProductType::all();
        $product->product_name    = $request->product_name;
        $product->price           = $request->price;
        $product->description     = $request->description;
        $product->sold_quantity   = $request->sold_quantity;
        $product->new             = $request->new;
        $product->id_product_type = $request->id_product_type;
        $product->save();
        return redirect('admin/product/index')->with('messages','Them thanh cong');
    }
public function store ( ProductRequest $ request ) { $ product = new Product ; $ types = ProductType :: all ( ) ; $ product -> product_name = $ request -> product_name ; $ product -> price = $ request -> price ; $ product -> description = $ request -> description ; $ product -> sold_quantity = $ request -> sold_quantity ; $ product -> new = $ request -> new ; $ product -> id_product_type = $ request -> id_product_type ; $ product -> save ( ) ; return redirect ( 'admin/product/index' ) -> with ( 'messages' , 'Them thanh cong' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//