storage url o'zgartirildi

This commit is contained in:
2026-04-28 16:00:18 +05:00
parent bb733d14c1
commit 0bf99a5e26
13 changed files with 80 additions and 30 deletions

View File

@@ -100,12 +100,19 @@ class Controller extends ExController
return view('dashboard.products.store', compact('categories', 'brands', 'colors', 'measurement'));
}
$product = $this->dispatchSync(StoreJob::fromRequest($request));
try {
$product = $this->dispatchSync(StoreJob::fromRequest($request));
$product->categories()->attach([$request->getCategoryID()]);
$product->categories()->attach([$request->getCategoryID()]);
$this->charSync($product, $request->characteristics);
$this->dispatchSync(new ChildJob($request, $product));
$this->charSync($product, $request->characteristics);
$this->dispatchSync(new ChildJob($request, $product));
} catch (Exception $e) {
return Response::json([
'status' => false,
'messages' => $e->getMessage()
], 500);
}
$this->success(trans('admin.messages.created'));