Actualizacuion de Rama Kquiroz
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
namespace App\Services;
|
||||
|
||||
use AizPackages\CombinationGenerate\Services\CombinationService;
|
||||
use App\Models\Cart;
|
||||
use App\Models\Color;
|
||||
use App\Models\Product;
|
||||
use App\Models\User;
|
||||
use App\Models\Wishlist;
|
||||
use App\Utility\ProductUtility;
|
||||
use Combinations;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -301,4 +303,19 @@ class ProductService
|
||||
|
||||
return $product_new;
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$product = Product::findOrFail($id);
|
||||
$product->product_translations()->delete();
|
||||
$product->stocks()->delete();
|
||||
$product->taxes()->delete();
|
||||
$product->wishlists()->delete();
|
||||
$product->carts()->delete();
|
||||
|
||||
if(Product::destroy($id)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user