Store a newly created resource in storage.

@param  \Illuminate\Http\FeatureCreateRequest  $request
@return \Illuminate\Http\Response
481888
public function store(FeatureCreateRequest $request)
    {
        $result = $this->service->create($request->except('_token'));

        if ($result && is_object($result)) {
            return redirect('admin/features/'.$result->id.'/edit')->with('message', 'Successfully created');
        } elseif ($result) {
            return redirect('admin/features')->with('message', 'Successfully created');
        }

        return redirect('admin/features')->with('errors', ['Failed to create']);
    }
57112
public function store(Request $request)
    {
        $this->authorize('createCategories');

        $this->validate($request, [
            'title'             => ['required'],
            'weight'            => ['required'],
            'enable_threads'    => ['required'],
            'private'           => ['required']
        ]);

        $category = $this->model()->create($request->only(['category_id', 'title', 'description', 'weight', 'enable_threads', 'private']));

        return $this->response($category, 201);
    }
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;
    }
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();
	}
532089
public function store( Request $request )
    {
        $data = $request->getContent();
        $patientInterface = $this->patientAdapter->toPatientInterface( $data );
        $this->patientRepository->create( $patientInterface );
        // TODO return response code
    }
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')]));
    }
409661
public function write($path, FeatureNode $feature)
    {
        file_put_contents($this->getCachePathFor($path), serialize($feature));
    }
1322473
public function store(RolesRequest $request)
    {
        if ($this->role->createWithUsers($request->all(), $request->users)) {
            flash(trans('core::messages.resource.resource created', ['name' => trans('user::roles.title.role')]));
        }

        return redirect()->route('backend::user.role.index');
    }
1039735
public function store(CreatePostRequest $request)
    {
        $this->authorize(PostsPolicy::PERMISSION_CREATE);

        $post = Post::createOne($request->getValidatedData());

        $this->transNotification('created', ['title' => $post->title], $post->toArray());

        return redirect()->route('admin::blog.posts.show', [$post]);
    }
1179036
public function save(\Illuminate\Http\Request $request)
    {
        if (($content = $this->getContent()) instanceof FormElementInterface) {
            $content->save($request);
        }
    }
1201260
public function store(PostRequest $request)
    {
        $this->data = objectify($request->except([
            '_token', 'newCategory', 'newTags'
        ]));

        if (! empty($this->data->tags)) {
            $this->buildTagsArray();
        }

        $post = $this->storeOrUpdatePost();

        if ($this->status->byHash($this->data->status)->name == 'Pending review') {
            $this->mailReviewer($post);
        }

        $action = ($request->hash == '') ? 'created' : 'updated';

        $this->tracert->log('posts', $post->id, $this->auth_user->id, $action);

        $message = trans('blogify::notify.success', [
            'model' => 'Post', 'name' => $post->title, 'action' => $action
        ]);
        session()->flash('notify', ['success', $message]);

        $hash = $this->auth_user->hash;
        $this->cache->forget("autoSavedPost-$hash");

        return redirect()->route('admin.posts.index');
    }
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);
    }
1275036
public function addAction(Request $request)
    {
        $feature = new Feature();

        $form = $this->get('form.factory')->create(FeatureType::class, $feature);

        if($form->handleRequest($request)->isValid()){

            $em = $this->getDoctrine()->getManager();
            $em->persist($feature);
            $em->flush();

            $request->getSession()->getFlashBag()->add('success', 'Caractéristique bien ajoutée');
            return $this->redirect($this->generateUrl('product_feature_table'));
        }
        return $this->render('DyweeProductBundle:Feature:add.html.twig', array('form' => $form->createView()));
    }
1262143
public function store(CreateOrderRequest $request)
    {
        $this->order->create($request->all());

        return redirect()->route('admin.order.order.show', $order->id)
            ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('order::orders.title.orders')]));
    }
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');
    }
1062857
public function store(CreateFeedRequest $request)
    {
        if(! class_exists($request->model)) return redirect()->back()->withInput()
            ->with('failed', 'This model does not exist. Please create model before creating feed.');

        $model = new $request->model;
        if(! method_exists($model, 'getFeedItems')) return redirect()->back()->withInput()
            ->with('failed', 'You must implement RssFeedInterface on your model before making feed');

        $this->feed->create($request->all());

        return redirect('admin/feeds');
    }
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');
    }