app/Http/Controllers/ProductController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Product  $product
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy($id)
    {
        $product = Product::find($id);
        if($product->photo != 'noimage'){
            Storage::delete('public/photo/'.$product->photo);
        }
        $product->delete();
        return redirect()->route('product.index')
            ->with('success', 'Product Deleted Successfully');
    }
public function destroy ( $ id ) { $ product = Product :: find ( $ id ) ; if ( $ product -> photo != 'noimage' ) { Storage :: delete ( 'public/photo/' . $ product -> photo ) ; } $ product -> delete ( ) ; return redirect ( ) -> route ( 'product.index' ) -> with ( 'success' , 'Product Deleted Successfully' ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .