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(Product $product)
    {
        $product->delete();
        return redirect()->back()->with('error','this product cannot be deleted');
       if(!$product){
           return redirect()->back()->with('error','this product cannot be deleted');
       }
    }
public function destroy ( Product $ product ) { $ product -> delete ( ) ; return redirect ( ) -> back ( ) -> with ( 'error' , 'this product cannot be deleted' ) ; if ( ! $ product ) { return redirect ( ) -> back ( ) -> with ( 'error' , 'this product cannot be deleted' ) ; } }
Remove the specified resource from storage.
Remove the specified resource from storage .
//