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(StoreProductRequest $request)
    {
        $inputs = $request->except('submit', 'image');
        $inputs['image'] = File::store('products', 'image');
        Product::create($inputs);
        return $this->redirect();
    }
public function store ( StoreProductRequest $ request ) { $ inputs = $ request -> except ( 'submit' , 'image' ) ; $ inputs [ 'image' ] = File :: store ( 'products' , 'image' ) ; Product :: create ( $ inputs ) ; return $ this -> redirect ( ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .