/** * @SWG\Post( * path="/vendors", * tags={"vendor"}, * summary="Create a vendor", * @SWG\Parameter( * in="body", * name="body", * @SWG\Schema(ref="#/definitions/Vendor") * ), * @SWG\Response( * response=200, * description="New vendor", * @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/Vendor")) * ), * @SWG\Response( * response="default", * description="an ""unexpected"" error" * ) * ) */ public function store(CreateVendorRequest $request) { $vendor = $this->vendorRepo->save($request->input()); $vendor = Vendor::scope($vendor->public_id)->with('country', 'vendorcontacts', 'industry', 'size', 'currency')->first(); $transformer = new VendorTransformer(Auth::user()->account, Input::get('serializer')); $data = $this->createItem($vendor, $transformer, ENTITY_VENDOR); return $this->response($data); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(CreateVendorRequest $request) { $data = $request->input(); if (!$this->checkUpdatePermission($data, $response)) { return $response; } $vendor = $this->vendorService->save($data); Session::flash('message', trans('texts.created_vendor')); return redirect()->to($vendor->getRoute()); }
/** * Store a newly created resource in storage. * * @return Response */ public function store(CreateVendorRequest $request) { $vendor = $this->vendorService->save($request->input()); Session::flash('message', trans('texts.created_vendor')); return redirect()->to($vendor->getRoute()); }
/** * @SWG\Post( * path="/vendors", * tags={"vendor"}, * summary="Create a vendor", * @SWG\Parameter( * in="body", * name="body", * @SWG\Schema(ref="#/definitions/Vendor") * ), * @SWG\Response( * response=200, * description="New vendor", * @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/Vendor")) * ), * @SWG\Response( * response="default", * description="an ""unexpected"" error" * ) * ) */ public function store(CreateVendorRequest $request) { $vendor = $this->vendorRepo->save($request->input()); $vendor = Vendor::scope($vendor->public_id)->with('country', 'vendor_contacts', 'industry', 'size', 'currency')->first(); return $this->itemResponse($vendor); }