Store submitted configurations.

@param \Illuminate\Http\Request $request
@return \Illuminate\Http\JsonResponse
335122
public function store(Request $request)
    {
        $config = $request->input('config');

        foreach (array_dot($request->input('data')) as $key => $value) {
            $path = $config . '.' . $key;
            $this->destroy($path);
            if (is_array($value)) {
                $value = implode(',', $value);
            }
            Configuration::create(['key' => $path, 'value' => $value]);
        }

        return $this->notifySuccess(trans('cms::config.success', ['config' => $config]));
    }
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);
    }
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;
    }
340883
private function buildConfig(Request $request)
    {
        $config = array(
            'mode' => $request->query->get('mode', 'browse'),
        );
        if (null !== $types = $request->query->get('types', array())) {
            // TODO validate types
            $config['types'] = $types;
        }
        return $config;
    }
368206
public function store(SubmitRequest $request)
    {
        $this->service->create($request->all());

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

        $data = $request->all();
        $structuredData =  $this->generateTitleAndSlug($data['form']);
        $form = $structuredData['form'];
        $errors = $structuredData['errors'];

        // return errors if there are any
        if(count($errors)) {
            return $this->response("From errors", 400, null, false, false, true, $errors);
        }

        // if category is being created
        if(!isset($form['categoryID'])) {
            // Order item
            $catCount = Category::where("postTypeID", $request->postTypeID)->count();
            $order = $catCount+1;
            $categoryModel = new Category();
        }else{
            // if category is being updated
            $categoryModel = Category::find($form['categoryID']);
            if(!$categoryModel) {
                return $this->response("Category doesn't exist", 500);
            }
            $order = $categoryModel->order;
            $oldTitle = $categoryModel->setAutoTranslate(false)->title;
        }

        // parent ID
        $parentID = 0;
        if(isset($form['parent']['categoryID'])) {
            $parentID = $form['parent']['categoryID'];
        }

        // Create Category
        $categoryModel->title = $form['title'];
        $categoryModel->postTypeID = $data['postTypeID'];
        $categoryModel->parentID = ($parentID ? $parentID: null);
        $categoryModel->featuredImageID = $form['featuredImageID'];
        $categoryModel->description = $form['description'];
        $categoryModel->slug = $form['slug'];
        $categoryModel->isVisible = $form['isVisible'];
        $categoryModel->order = $order;
        $categoryModel->createdByUserID = Auth::user()->userID;
        $categoryModel->customFields = $request->customFieldValues;

        // return results
        if ($categoryModel->save()) {
            if(isset($form['categoryID'])) {
                // update label in menu link with the category title
                $this->updateMenuLinkLabel($data['id'], $form['title'], $oldTitle);
            }
            $redirect = $this->redirect($request->redirect, $categoryModel->categoryID, $data['postTypeID']);
            $response = $this->response('Category is saved', 200, $redirect['id'], $redirect['view'], $redirect['url']);
        }else{
            $response = $this->response('Category is not saved. Please try again later!', 500);
        }
        return $response;
    }
187786
public function store(Request $request) {

        // Get a washed array of the create form's input fields
        $data = $this->adminEmailProcessing->washCreateForm($request);

        // Validate the create form's input fields
        $validator = $this->adminEmailProcessing->validateCreateForm($data);

        // Did validate pass or fail?
        if ($validator->fails()) {
            return redirect('admin/emailhandling/create')
                ->withErrors($validator)
                ->withInput()
            ;
        }

        // Populate the fields
        // $data is an array
        $data = $this->adminEmailProcessing->populateCreateFields($data);

        // INSERT the record
        $savedOk = $this->repository->insertNewRecord($data);

        $message     =  "You successfully created your new email message!";

        if ($request->input('send_email') == "Save & Send") {
            $message = "You successfully updated, and sent, your email message!";
        }

        $status_code = 200;

        if (!$savedOk) {
            $message     =  "There was a problem saving your new email message!";
            $status_code = 400;
        }

        Session::flash('message',     $message);
        Session::flash('status_code', $status_code );

        if (!$savedOk) {
            return redirect('admin/emailhandling/create')
                ->withInput()
            ;
        }

        if ($request->input('send_email') == "Save & Send") {

            // send the email
            $this->adminEmailProcessing->sendEmail($data);
        }

        return Redirect::route('admin.emailhandling.index');
    }
671953
public function store(Request $request)
    {
        $this->validate($request, [
            'title' => 'required|unique:laramanager_resources|max:255',
            'slug' => 'required|unique:laramanager_resources|max:255',
            'model' => 'required|model_must_exist|unique:laramanager_resources|max:255',
            'namespace' => 'required|max:255',
            'order_column' => 'required|integer',
            'order_direction' => 'required|in:asc,desc'
        ]);

        $resource = $this->resource->create($request->merge(['icon' => 'n/a'])->all());

        $this->navigationLink->create([
            'title' => $resource->title,
            'uri' => 'admin/' . $resource->slug,
            'laramanager_navigation_section_id' => 2
        ]);

        return redirect('admin/resources/' . $resource->id . '/fields');
    }
1261579
public function store(Request $request)
    {
        $menu = Menu::create($request->input());

        return $this->response()->item($menu, new MenuTransformer());
    }
630534
public function store(Request $request)
    {
        $this->validate($request, [
            'name'      => 'required',
            'color'     => 'required',
        ]);

        $category = new Category();
        $category->create(['name' => $request->name, 'color' => $request->color]);

        Session::flash('status', trans('ticketit::lang.category-name-has-been-created', ['name' => $request->name]));

        \Cache::forget('ticketit::categories');

        return redirect()->action('\Kordy\Ticketit\Controllers\CategoriesController@index');
    }
32895
public function store(Request $request)
    {
        try {
            $validation = app(ValidationService::class)->check(['location' => 'required']);
            if (!$validation['errors']) {
                foreach ($request->input('location') as $image) {
                    $imageSaved = $this->repository->store([
                        'location' => $image,
                        'is_published' => $request->input('is_published'),
                        'tags' => $request->input('tags'),
                    ]);
                }

                Cms::notification('Image saved successfully.', 'success');

                if (!$imageSaved) {
                    Cms::notification('Image was not saved.', 'danger');
                }
            } else {
                Cms::notification('Image could not be saved', 'danger');

                return $validation['redirect'];
            }
        } catch (Exception $e) {
            Cms::notification($e->getMessage() ?: 'Image could not be saved.', 'danger');
        }

        return redirect(route($this->routeBase.'.images.index'));
    }
777051
public function store(Request $request)
    {
        $this->validate($request, [
            'author_id' => ['required', 'integer'],
            'title'     => ['required'],
            'content'   => ['required']
        ]);

        $category = Category::find($request->input('category_id'));

        $this->authorize('createThreads', $category);

        if (!$category->threadsEnabled) {
            return $this->buildFailedValidationResponse($request, trans('forum::validation.category_threads_enabled'));
        }

        $thread = $this->model()->create($request->only(['category_id', 'author_id', 'title']));
        Post::create(['thread_id' => $thread->id] + $request->only('author_id', 'content'));

        return $this->response($thread, 201);
    }
392381
public function store(Request $request)
    {
        $this->validate($request, [
            'theme' => 'required',
        ]);

        /** @var Configuration $config */
        $config        = Configuration::query()->firstOrCreate(['key' => 'theme.frontend']);
        $config->value = $request->get('theme');
        $config->save();

        flash()->success(trans('cms::theme.success', ['theme' => $request->get('theme')]));

        return back();
    }
1083157
public function store(Request $request)
    {
        $category = $this->api('category.fetch', $request->route('category'))->get();

        if (!$category->threadsEnabled) {
            Forum::alert('warning', 'categories.threads_disabled');

            return redirect(Forum::route('category.show', $category));
        }

        $thread = [
            'author_id'     => auth()->user()->getKey(),
            'category_id'   => $category->id,
            'title'         => $request->input('title'),
            'content'       => $request->input('content')
        ];

        $thread = $this->api('thread.store')->parameters($thread)->post();

        Forum::alert('success', 'threads.created');

        return redirect(Forum::route('thread.show', $thread));
    }
433637
public function store(Request $request)
  {
    $input = $request->all();
    $input['password'] = Hash::make($input['password']);
    $user = $this->users->create($input);

    //create Blank profile
    $profile = Profile::create([
      'user_id' => $user->id,
      'bio'     => '',
    ]);
    $profile->save();

    return \Redirect::route('admin.users.index', [
      ])->withMessage(trans('acl::user.users-controller-successfully_created'));
    }
1213824
public function store(Request $request)
    {
        $this->validate($request, ['name' => 'required']);

        $role = Role::create($request->all());
        $role->permissions()->detach();

        if ($request->has('permissions')) {
            foreach ($request->permissions as $permission_name) {
                $permission = Permission::whereName($permission_name)->first();
                $role->givePermissionTo($permission);
            }
        }

        return redirect('admin/roles')->with('flash_message', 'Role added!');
    }
508873
public function store(Create $request)
    {
        $data = $request->all();

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

        return $this->redirect('roles.index');
    }