Store a newly created resource in storage.

@param  \Illuminate\Http\Request  $request
@return \Illuminate\Http\Response
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');
    }
13168
public function store(Request $request)
    {
        $user_setting = new User_setting();

        
        $user_setting->user_id = $request->user_id;

        
        $user_setting->setting_id = $request->setting_id;

        
        $user_setting->notes = $request->notes;

        
        
        $user_setting->save();

        return redirect('user_setting');
    }
1099547
public function store(Request $request)
    {
        foreach ($request->except(['_token', '_method']) as $key => $value) {
            $configModel = $this->repository->findByKey($key);

            if (null === $configModel) {
                $data['configuration_key'] = $key;
                $data['configuration_value'] = $value;

                $this->repository->create($data);
            } else {
                $configModel->update(['configuration_value' => $value]);
            }
        }
        return redirect()->route('admin.configuration')
            ->with('notificationText', 'All Configuration saved!');
    }
975646
public function store(Request $request)
    {
        // Validate the form data
        $result = $this->validate($request, [
            'name' => 'required',
            'slug' => 'required|alpha_dash|unique:roles',
        ]);

        // Create the Role
        $role = Sentinel::getRoleRepository()->createModel()->create([
            'name' => trim($request->get('name')),
            'slug' => trim($request->get('slug')),
        ]);

        // Cast permissions values to boolean
        $permissions = [];
        foreach ($request->get('permissions', []) as $permission => $value) {
            $permissions[$permission] = (bool)$value;
        }

        // Set the role permissions
        $role->permissions = $permissions;
        $role->save();

        // All done
        if ($request->expectsJson()) {
            return response()->json(['role' => $role], 200);
        }

        session()->flash('success', "Role '{$role->name}' has been created.");
        return redirect()->route('roles.index');
    }
324973
public function store(Request $request)
    {
        try {
            $this->dispatch(new AttemptUserLogin($request->get('email'), $request->get('password'), $request->get('remember')));
            return redirect()->intended($this->config->get('authentication.login.redirectUri'));
        } catch (LoginFailed $e) {
            return redirect()->back()->withInput()->withErrors([
                'authentication::login_error' => $e->getMessage()
            ]);
        } catch (UserIsBanned $e) {
            return redirect()->back()->withInput()->withErrors([
                'authentication::login_error' => $e->getMessage()
            ]);
        }
    }
1002934
public function addAction(Request $request)
    {
        $storage = new Storage();

        /* @var $form Form */
        $form = $this->createForm(new StorageForm(), $storage);

        if ($request->getMethod() == 'POST') {
            $form->handleRequest($request);
            if ($form->isValid()) {
                $em = $this->getDoctrine()->getManager();
                $em->persist($storage);
                $em->flush();

                return $this->redirect($this->generateUrl('storage_list'));
            }
        }

        return $this->render('AnimeDbCatalogBundle:Storage:add.html.twig', [
            'form' => $form->createView(),
            'guide' => $this->get('anime_db.api.client')->getSiteUrl(self::GUIDE_LINK),
        ]);
    }
1225492
public function store(Request $request)
    {
        $feature = new Feature();

        
        $feature->name = $request->name;

        $feature->featuretype_id = $request->featuretype_id;
        
        $feature->description = $request->description;

        
        $feature->demonstration_URL = $request->demonstration_URL;

        if($feature->package_id == '') {
            $feature->package_id = null;

        } else {
            $feature->package_id = $request->package_id;
            
        }

        
        
        $feature->save();

        return redirect('unstarter/feature');
    }
167959
public function store(Request $request)
    {
        $createResource = $this->createResourceCallable();
        $resource = new CreateResource($this->serializer);

        $model = $this->getDataModel();
        $data = (array) $request->get('data');
        if (array_key_exists('attributes', $data) && $model->timestamps) {
            $data['attributes'][$model::CREATED_AT] = Carbon::now()->toDateTimeString();
            $data['attributes'][$model::UPDATED_AT] = Carbon::now()->toDateTimeString();
        }

        return $this->addHeaders(
          $resource->get($data, get_class($this->getDataModel()), $createResource)
        );
    }
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;
    }
412629
public function store(Request $request)
    {
        $attributes = $request->validate([
            'text' => 'required'
        ]);

        $comment = Comment::create($attributes);

        $comment->mention($request->mentions);

        return back();
    }
1099923
public function store(Request $request)
    {
        $name = \Transliteration::clean_filename(strtolower($request->label));
        $label = $request->label;

        try
        {
            WorkflowState::create([
                            'name' => $name,
                            'label' => $label,
                ]);
        }
        catch(\Illuminate\Database\QueryException $e){
            // do what you want here with $e->getMessage();
            return redirect()->route('state')->with('message', 'Error');
        }

        return redirect()->route('state')->with('message', 'Add data success');
    }
78770
public function store(Request $request)
    {
        try {
            $this->roleRepositoryInterface->create($request->all());
        } catch (FormValidationException $e) {
            Flash::error($e->getMessage());

            return redirect()
              ->route('roles.create')
              ->withErrors($e->getErrors())
              ->withInput();
        }

        Flash::success(trans('dashboard::dashboard.flash.role.create.success'));

        return redirect()->route('roles.index');
    }
1215980
public function store(Request $request)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Media', 'create')) {
            return $this->noPermission();
        }
        return (new Media())->upload($request);
    }
532089
public function store( Request $request )
    {
        $data = $request->getContent();
        $patientInterface = $this->patientAdapter->toPatientInterface( $data );
        $this->patientRepository->create( $patientInterface );
        // TODO return response code
    }
352762
public function store(Request $request)
    {
        if (is_null(request()->file('media'))) {
            $attributes = request()->validate(array_except(PageContent::$rules, 'media'),
                PageContent::$messages);
        }
        else {
            $attributes = request()->validate(PageContent::$rules, PageContent::$messages);

            $media = $this->moveAndCreatePhoto($attributes['media']);
            if ($media) {
                $attributes['media'] = $media;
            }
        }

        $pageContent = $this->createEntry(PageContent::class, $attributes);

        return redirect('admin/pages/'.$request->page_id.'/sections/content/'.$pageContent->id.'/edit');
    }
925723
public function store(Request $request)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate([
            'memberIds.*' => 'required|exists:' . config('combine-core.tablePrefix', 'combine') . '_members,id',
            'memberTagIds.*' => 'required|exists:' . config('combine-core.tablePrefix', 'combine') . '_member_tags,id',
            'locationId' => 'exists:' . config('combine-core.tablePrefix', 'combine') . '_locations,id',
            'start' => 'required|date',
        ]);
        $job = new Job;
        $job->start = Carbon::parse($request->start);
        $job->location_id = $request->locationId;
        $job->team_id = $this->userContext()->team_id;
        $job->save();
        $job->members()->attach($request->memberIds);
        $job->member_tags()->attach($request->memberTagIds);
        return fractal($job, new JobTransformer())
            ->withResourceName('job')
            ->respond();
    }
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');
    }