Store a newly created resource in storage.

@param    \Illuminate\Http\Request  $request
@return  \Illuminate\Http\Response
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');
    }
1099672
public function store(Request $request)
    {
        $this->validate(
            $request,
            [
                'name' => 'required',
                'email' => 'required|string|max:255|email|unique:users',
                'password' => 'required',
                'roles' => 'required'
            ]
        );

        $data = $request->except('password');
        $data['password'] = bcrypt($request->password);
        $user = User::create($data);

        foreach ($request->roles as $role) {
            $user->assignRole($role);
        }

        return redirect('admin/users')->with('flash_message', 'User added!');
    }
707292
public function store( Request $request )
    {
        $data = $request->getContent();
        $parser = new \PHPFHIRGenerated\PHPFHIRResponseParser();
        $fhirBundle = $parser->parse( $data );
        if ( is_a( $fhirBundle, '\PHPFHIRGenerated\FHIRResource\FHIRBundle' ) ) {

            // Instansiate the response bundle
            $fhirResponseBundle = new FHIRBundle();

            // Iterate over each entry in the Request Bundle and handle them according to
            // their Request elements
            $entries = $fhirBundle->getEntry();
            foreach ( $entries as $entry ) {

                // First get the proper resource out of the Resource Container
                $resourceContainer = $entry->getResource();
                $publicVars = get_object_vars( $resourceContainer );
                foreach ( $publicVars as $resourceKey => $value ) {
                    if ( $value !== null ) {
                        // This is resource that our Resource Container is holding
                        $resource = $resourceContainer->{$resourceKey};
                        break;
                    }
                }

                // Prepare to build the response for this entry
                $responseEntry = new FHIRBundle\FHIRBundleEntry();
                $bundleResponse = new FHIRBundle\FHIRBundleResponse();

                try {
                    //$repositoryClass = "Mi2\\Emr\\Contracts\\{$resourceKey}RepositoryInterface";
                    //$repository = App::make( $repositoryClass );

                    $adapterClass = "\\Mi2\\FHIR\\Adapters\\FHIR{$resourceKey}Adapter";
                    $adapter = App::make( $adapterClass );
                    //$adapter = new $adapterClass( $repository );

                    // Figure out what to do with the Resource by processing the Request for the Entry
                    $request = $entry->getRequest();
                    $method = $request->getMethod();

                    // Take action and build appropriate response
                    if ( $method->getValue() == 'POST' ) {
                        // Store the Resource and get the newly created interface
                        // TODO check to make sure adapter implements these methods
                        $interface = $adapter->modelToInterface( $resource );
                        $storedInterface = $adapter->storeInterface( $interface );

                        // Build response
                        $bundleResponseStatus = new FHIRString();
                        $bundleResponseStatus->setValue('201 Created');
                        $bundleResponse->setStatus( $bundleResponseStatus );

                        $bundleResponseLocation = new FHIRUri();
                        $bundleResponseLocation->setValue("{$resourceKey}/{$interface->getId()}");
                        $bundleResponse->setLocation( $bundleResponseLocation );

                    }

                    $responseResource = $adapter->interfaceToModel( $storedInterface );
                    $responseResourceId = new FHIRId();
                    $responseResourceId->setValue( $interface->getId() );
                    $responseResource->setId( $responseResourceId );
                    $responseResourceContainer = new FHIRResourceContainer();
                    $responseResourceContainer->{$resourceKey} = $responseResource;

                    $responseEntry->setResource( $responseResourceContainer );

                } catch ( Exception $e ) {
                    // TODO Put error codes in response
                    // Build error response
                    $bundleResponseStatus = new FHIRString();
                    $bundleResponseStatus->setValue('500 Internal Server Error');
                    $bundleResponse->setStatus( $bundleResponseStatus );
                }

                $responseEntry->setResponse( $bundleResponse );
                $fhirResponseBundle->addEntry( $responseEntry );

            }

        } else {
            // Error, the Resource does not match, expecting a Bundle,
            // // but got something else.
        }

        // Complete the response
        $fhirBundleType = new FHIRBundleType();
        $fhirBundleType->setValue( 'transaction-response' );
        $fhirResponseBundle->setType( $fhirBundleType );

        return $fhirResponseBundle;
    }
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();
    }
304793
public function store(Request $request)
    {
        $this->validate(request(), [
            'name' => 'required|min:3|max:15',
            'email' => 'required|email|unique:admins',
            'password' => 'required|min:4'
        ]);

        Admin::create([
            'name' => request('name'),
            'email' => request('email'),
            'password' => bcrypt(request('password')),
            'role_id' => 1
        ]);

        session()->flash('success', 'Usuario registrado con éxito!');
        return redirect()->route('usuarios.index');
    }
601188
public function store(Request $request)
    {
        $thread = $this->api('thread.fetch', $request->route('thread'))->parameters(['with' => ['posts']])->get();

        $this->authorize('reply', $thread);

        $post = null;
        if ($request->has('post')) {
            $post = $thread->posts->find($request->input('post'));
        }

        $post = $this->api('post.store')->parameters([
            'thread_id' => $thread->id,
            'author_id' => auth()->user()->getKey(),
            'post_id'   => is_null($post) ? 0 : $post->id,
            'content'   => $request->input('content')
        ])->post();

        $post->thread->touch();

        Forum::alert('success', 'general.reply_added');

        return redirect(Forum::route('thread.show', $post));
    }
412629
public function store(Request $request)
    {
        $attributes = $request->validate([
            'text' => 'required'
        ]);

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

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

        return back();
    }
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()
            ]);
        }
    }
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)
        );
    }
901862
public function store(Request $request)
    {
        try {
            $blockType = $this->blockTypes->save($request);
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.create', ['object' => trans('soda::terminology.block_type')]));
        }

        return redirect()->route('soda.block-types.edit', $blockType->getKey())->with('success', trans('soda::messages.created', ['object' => trans('soda::terminology.block_type')]));
    }
1349079
public function store(Request $request)
    {
        $package = new Package();

        
        $package->name = $request->name;

        
        $package->description = $request->description;

        
        $package->string_composer = $request->string_composer;
        $package->description_does_what = $request->description_does_what;
        $package->dashboard_URL = $request->dashboard_URL;
        $package->github_URL = $request->github_URL;

        
        
        $package->save();

        return redirect('package');
    }
462132
public function storeRefererUrlFromRequest(Request $request): RequestService
    {
        $url = $this->getRefererUrl($request);

        /*
         * No referer?
         * Nothing to do
         */
        if ('' === $url) {
            return $this;
        }

        return $this->storeRefererUrl($url);
    }
1261579
public function store(Request $request)
    {
        $menu = Menu::create($request->input());

        return $this->response()->item($menu, new MenuTransformer());
    }
972328
public function store(Request $request)
    {
        if (!$this->can('create-' . Str::plural($this->slug), auth()->user()->id)) {
            abort(404);
        }
        // $this->newRequest = $request->all();

        $this->validation($request);

        $request = $this->HandleRequest($request);

        $model = Laramin::model($this->type->name)->create($request->toArray());

        // $this->relationAfterSaving($request, $model, $this->getInfoOfType(), true);

        Session::flash($this->flashname, $this->SessionMessage("Your {$this->slug} Has Been Succesfully Added", 'success'));

        return redirect()->route('laramin.' . $this->slug . '.index');
    }
115982
public function store(Request $request)
    {
        $attributes = request()->validate(News::$rules, News::$messages);

        $news = $this->createEntry(News::class, $attributes);

        return redirect_to_resource();
    }
1054477
public function store($request)
    {
        $this->fireEvent('creating', [$request]);

        $created = $this->model->create($request);

        $this->fireEvent('created', [$created]);

        return $created;
    }
629857
public function store(Request $request)
    {
        $this->authorize('create', File::class);
        $input = $this->validator->validate('create');
        if ($request->hasFile('file')) {
            $uploadedFile = $request->file('file');
            if ($uploadedFile->isValid()) {
                try {
                    $file = $this->fileRepo->create($input, $uploadedFile, auth()->user());
                    return $this->respondWithSuccess($file, new FileTransformer);
                } catch (RepositoryValidationException $e) {
                    return $this->respondWithError($e->getMessage());
                }
            }
        }
        return $this->respondWithError('The file could not be uploaded - invalid or missing file');
    }