kitService = $kitService; } /** * Show Bulk Checkout Page * @return View View to checkout multiple assets */ public function showCheckout($kit_id) { // METODO: добавить больше проверок, тут ещё и модель и прочее что мне надо бу $this->authorize('checkout', Asset::class); $kit = PredefinedKit::findOrFail($kit_id); return view('kits/checkout')->with('kit', $kit); } /** * Validate and process the new Predefined Kit data. * * @author [A. Gianotto] [] * @since [v1.0] * @return Redirect */ public function store(Request $request, $kit_id) { $user_id = e($request->get('user_id')); if ( is_null($user = User::find( $user_id )) ) { return redirect()->back()->with('error', trans('admin/users/message.user_not_found')); } $kit = new PredefinedKit(); $kit->id = $kit_id; $errors = $this->kitService->checkout($request, $kit, $user); if( count($errors) > 0 ) { return redirect()->back()->with('error', trans('admin/hardware/message.checkout.error'))->with('error_messages', $errors); } return redirect()->back()->with('success', trans('admin/hardware/message.checkout.success')); } }