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 * فعال/غیرفعال محصول — show باید با active هم‌گام باشد (اپ کاربر از show استفاده می‌کند).
* @return \Illuminate\Http\JsonResponse
*/ */
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) public function hide($id)
{ {
$query = Product::findOrFail($id); $query = Product::findOrFail($id);