app/Http/Controllers/__Old__/__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(CreateProductRequest $request)
    {
        $product = new Product;
            $product->title = $request->title;
            $product->description = $request->description;
            $product->price = $request->price;
            $product->user_id = Auth::user()->id;
        $product->save();
        return redirect()->route('products.index')
                         ->with('success','Product created successfully');
    }
public function store ( CreateProductRequest $ request ) { $ product = new Product ; $ product -> title = $ request -> title ; $ product -> description = $ request -> description ; $ product -> price = $ request -> price ; $ product -> user_id = Auth :: user ( ) -> id ; $ product -> save ( ) ; return redirect ( ) -> route ( 'products.index' ) -> with ( 'success' , 'Product created successfully' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//Item::create($request->all());