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(newProduct $request)
    {
        Products::addProduct($request);
        Session::forget("productImages");
        $directories = Storage::files('images');
        foreach($directories as $image) {
            Storage::delete($image);
        }
        return redirect("/admin/products");
    }
public function store ( newProduct $ request ) { Products :: addProduct ( $ request ) ; Session :: forget ( " productImages " ) ; $ directories = Storage :: files ( 'images' ) ; foreach ( $ directories as $ image ) { Storage :: delete ( $ image ) ; } return redirect ( " /admin/products " ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .