/** * Store a newly created StickerStore in storage. * * @param CreateStickerStoreRequest $request * * @return Response */ public function store(CreateStickerStoreRequest $request) { $input = $request->all(); $input['objectId'] = str_random(10); if ($request->file('stickerImg')) { $uploadImage = $this->uploadImage($request->file('stickerImg'), '/stickers_photo/'); $input['stickerImg'] = $uploadImage['resize_url'][0]; } $stickerStore = $this->stickerStoreRepository->create($input); Flash::success('StickerStore saved successfully.'); return redirect(route('stickerStores.index')); }
/** * Store a newly created StickerStore in storage. * POST /stickerStores * * @param Request $request * * @return Response */ public function store(Request $request) { if (sizeof(StickerStore::$rules) > 0) { $validator = $this->validateRequestOrFail($request, StickerStore::$rules); if ($validator) { return $validator; } } $input = $request->all(); $input['objectId'] = str_random(10); $stickerStores = $this->stickerStoreRepository->create($input); return $this->sendResponse($stickerStores->toArray(), "StickerStore saved successfully"); }