public function delete($id) { $product = Product::find($id); /** * Remove the product , all its linked categories and delete the thumbnail */ File::delete(public_path() . $product->thumbnail); CategoryProduct::whereProduct_id($id)->delete(); $product->delete(); return \Redirect::back(); }