listing($request->user(), $request->all()); return $request->expectsJson() ? response()->json($data) : Inertia::render('management/experiments/index', $data); } public function create(Request $request, ProductExperiments $experiments): Response|JsonResponse { return $this->show($request, $experiments); } public function show(Request $request, ProductExperiments $experiments, ?string $id = null): Response|JsonResponse { $data = $experiments->view($request->user(), $id, $request->all()); return $request->expectsJson() ? response()->json($data) : Inertia::render('management/experiments/edit', $data); } public function store(Request $request, ProductExperiments $experiments): JsonResponse { return response()->json($experiments->save($request->user(), null, $request->all()), 201); } public function revise(Request $request, ProductExperiments $experiments, string $id): JsonResponse { return response()->json($experiments->save($request->user(), $id, $request->all())); } }