Store a newly created Images in storage.

@param ImagesRequest $request

@return Response
322700
public function apiStore(Request $request)
    {
        $image = $this->repository->apiStore($request->all());

        return app(CmsResponseService::class)->apiResponse('success', $image);
    }
318265
public function store(Request $request)
	{
		$attributes = request()->validate(NewsCategory::$rules, NewsCategory::$messages);

        $category = $this->createEntry(NewsCategory::class, $attributes);

        return redirect_to_resource();
	}
479907
public function store(Request $request)
    {
        $this->validate($request, ['name' => 'required']);

        Permission::create($request->all());

        return redirect('admin/permissions')->with('flash_message', 'Permission added!');
    }
988888
public function store(Request $request)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('PostType', 'create')) {
            return $this->noPermission();
        }
        // custom messages for validation
        $messages = array(
            'name.required'=>'Post type name is required',
        );
        // validation
        $validator = Validator::make(
            $request->all(), [
            'name' => 'required',
            'isVisible' => 'required'
            ], $messages
        );

        // if validation fails return json response
        if ($validator->fails()) {
            return $this->response("Please check all required fields!", 400, null, false, false, true, $validator->errors());
        }

        if(isset($request->id)) {
            $postType = PostType::findOrFail($request->id);
            $customFieldsArray = PostType::updateTable($request->slug, $request->fields, $request->hasCategories, $request->hasTags);
        }else{
            $slug = $request->slug;
            if(isset($slug) && empty($slug)) {
                $slug = self::generateSlug($request->name, 'post_type', 'postTypeID', App::getLocale(), 0);
            }else{
                $slug = self::generateSlug($request->slug, 'post_type', 'postTypeID', App::getLocale(), 0);
            }
            // create new table for the posts of the post type
            $customFieldsArray = PostType::createTable($slug, $request->fields, $request->hasCategories, $request->hasTags);

            // Create post type
            $postType = new PostType();
            $postType->createdByUserID  = Auth::user()->userID;
            $postType->slug = $slug;
        }

        $postType->name             = $request->name;
        $postType->isVisible        = $request->isVisible;
        $postType->fields           = $customFieldsArray;
        $postType->hasCategories    = $request->hasCategories;
        $postType->isCategoryRequired = $request->isCategoryRequired;
        $postType->hasTags          = $request->hasTags;
        $postType->isTagRequired    = $request->isTagRequired;
        $postType->hasFeaturedImage = $request->hasFeaturedImage;
        $postType->isFeaturedImageRequired = $request->isFeaturedImageRequired;
        $postType->hasFeaturedVideo = $request->hasFeaturedVideo;
        $postType->isFeaturedVideoRequired = $request->isFeaturedVideoRequired;

        // return results
        if ($postType->save()) {
            if(isset($request->id)) {
                // delete fields
                foreach($request->deletedFieldsSlugs as $fieldsSlug){
                    $this->deleteField($postType->slug, $fieldsSlug);
                }
            }

            $redirectParams = parent::redirectParams($request->redirect, 'post-type', $postType->postTypeID);
            return $this->response('Post type stored', 200, $postType->postTypeID, $redirectParams['view'], $redirectParams['redirectUrl']);
        }else{
            return $this->response('Post Type is not stored. Internal sever error', 500);
        }
    }
744312
public function store(CreatePermissionRequest $request)
    {
        $input = $request->all();

        $permission = $this->repository->create($input);
        $permission->load($request->getWith());

        return $this->sendResponse($permission, 'Permission saved successfully.');
    }
915146
public function store(Request $request)
    {
        // Carregar objeto JSON
        $obj = $this->getJsonContent($request);
        if (is_null($obj)) {
            $this->error('JSON invalid', 500);
        }

        // Salvar
        $model = $this->setValues($obj);

        return response()->json($model);
    }
540941
public function store(ImageFormRequest $request, Page $page): void
    {
        $page->addMediaFromRequest('file')
             ->sanitizingFileName(function ($fileName) {
                 return md5($fileName).'.'.pathinfo($fileName, PATHINFO_EXTENSION);
             })
             ->toMediaCollection('default', config('cortex.pages.media.disk'));
    }
250286
public function store(CreateStorageRequest $request)
    {
        $this->storage->create($request->all());

        return redirect()->route('admin.product.storage.index')
            ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));
    }
56582
public function upload(Request $request)
    {
        try {
            $realPath = Storage::disk($this->filesystem)->getDriver()->getAdapter()->getPathPrefix();

            $allowedImageMimeTypes = [
                'image/jpeg',
                'image/png',
                'image/gif',
                'image/bmp',
                'image/svg+xml',
            ];

            if (in_array($request->file->getMimeType(), $allowedImageMimeTypes)) {
                $file = $request->file->store($request->upload_path, $this->filesystem);

                $image = Image::make($realPath.$file);

                if ($request->file->getClientOriginalExtension() == 'gif') {
                    copy($request->file->getRealPath(), $realPath.$file);
                } else {
                    $image->orientate()->save($realPath.$file);
                }
            } else {
                $file = $request->file->move($realPath, $request->file->getClientOriginalName());
            }

            $success = true;
            $message = __('admin.media.success_uploaded_file');
            $path = preg_replace('/^public\//', '', $file);
        } catch (Exception $e) {
            $success = false;
            $message = $e->getMessage();
            $path = '';
        }

        return response()->json(compact('success', 'message', 'path'));
    }
1116039
public function uploadImage(ImageUploadRequest $request)
    {
        $image_name = $this->resizeAndSaveImage($request->file('upload'));
        $path = config('app.url').'/uploads/posts/'.$image_name;
        $func = $request->get('CKEditorFuncNum');
        $result = "<script>window.parent.CKEDITOR.tools.callFunction($func, '$path', 'Image has been uploaded')</script>";

        return $result;
    }
1153994
public function store(Request $request)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Tags', 'create')) {
            return $this->noPermission();
        }

        $validatorData = [
            'title' => 'required',
            'postTypeID' => 'required',
            'slug' => 'required|max:500|unique:tags',
        ];

        if(isset($request->formData['id'])) {
            // Update Tag
            $tags = Tag::findOrFail($request->formData['id']);
            $validatorData['slug'] = 'required';
        }else{
            $tags = new Tag();
            $tags->createdByUserID = Auth::user()->userID;
            $tags->postTypeID = $request->formData['postTypeID'];
        }

        // validation
        $validator = Validator::make($request->formData, $validatorData, []);
        // check validation
        if ($validator->fails()) {
            return $this->response("Please check all required fields!", 400, null, false, false, true, $validator->errors());
        }

        $tags->title         = $request->formData['title'];
        $tags->description   = $request->formData['description'];
        $tags->slug          = $request->formData['slug'];
        $tags->featuredImageID = ($request->formData['featuredImage']  !== 0 ? $request->formData['featuredImage'] : null);

        // return results
        if ($tags->save()) {
            $redirect = $this->redirect($request->formData['redirect'], $tags->tagID, $request->formData['postTypeID']);
            $result = $this->response('Tag is saved', 200, $redirect['id'], $redirect['view'], $redirect['url']);
        }else{
            $result = $this->response('Internal server error. Please try again later', 500);
        }
        return $result;
    }
322940
public synchronized void put(WmsRequest request, byte[] image) {
        synchronized (this) {
            String key = getKey(request);
            // make sure it's the last on the list of keys so won't be dropped
            // from cache
            keys.remove(key);
            keys.add(key);
            if (keys.size() > maxSize)
                remove(keys.get(0));
            if (maxSize > 0 && layers.containsAll(request.getLayers())) {
                cache.put(key, image);
                log.info("cached image with key=" + key);
            }
        }
    }
164380
public function store(FormRequest $request)
    {
        $data = $request->all();
        $model = $this->repository->create($data);

        return $this->redirect($request, $model);
    }
824365
public function store(Request $request)
	{
		$attributes = request()->validate(Settings::$rules, Settings::$messages);

        $setting = $this->createEntry(Settings::class, $attributes);

        log_activity('Setting Created', 'A Setting was successfully created', $setting);

        return redirect_to_resource();
	}
197688
public function store(Request $request)
    {
        $this->validate($request, $this->validationRules($this->resource));
        $entry = $this->entriesRepository->create($request, $this->resource);

        return redirect('admin/' . $this->resource->slug)->with('success', 'Added');
    }
1147475
public function store(Create $request)
    {
        $data = $request->all();

        unset($data['image']);

        if (\Input::hasFile('image')) {
            // upload image
            $this->uploader->upload('image')->save('images/articles');

            $data['image'] = $this->uploader->getFilename();
        }

        $data['user_id'] = \Auth::id();
        $data['slug'] = Str::slug($data['title']);

        $this->repository->create($data);

        return $this->redirect(isOnPages() ? 'pages.index' : 'articles.index');
    }
30501
public function imageUploadAction(Request $request)
    {
        $image = new ImageField();
        /* @var $form Form */
        $form = $this->createForm(new UploadImage(), $image);
        $form->handleRequest($request);

        if (!$form->isValid()) {
            $errors = $form->getErrors();

            return new JsonResponse(['error' => $this->get('translator')->trans($errors[0]->getMessage())], 404);
        }

        // try upload file
        try {
            $this->get('anime_db.downloader')->imageField($image);

            return new JsonResponse([
                'path' => $image->getFilename(),
                'image' => $image->getWebPath(),
            ]);
        } catch (\InvalidArgumentException $e) {
            return new JsonResponse(['error' => $this->get('translator')->trans($e->getMessage())], 404);
        }
    }