fix show in app

This commit is contained in:
2026-06-06 13:47:26 +03:30
parent 5ce821ecfd
commit e22ce8b737
@@ -262,9 +262,20 @@ class ProductController extends SuperController
}
/**
* @param $id
* @return \Illuminate\Http\JsonResponse
* فعال/غیرفعال محصول — show باید با active هم‌گام باشد (اپ کاربر از show استفاده می‌کند).
*/
public function active($id)
{
$product = Product::findOrFail($id);
$active = !$product->active;
$product->update([
'active' => $active,
'show' => $active,
]);
return response()->json(true);
}
public function hide($id)
{
$query = Product::findOrFail($id);