Store a newly created resource in storage.

@param Request $request

@return Response
964446
public function store(Request $request)
    {
        $data = $request->all();
        $data['resource'] = $data['controller'] . '@' . $data['method'];

        $validator = Validator::make(
            $data,
            $this->getValidationRules()
        );

        if ($validator->fails()) {
            return back()->withInput()->withErrors($validator);
        }

        Permission::create($data);

        return redirect()->action('\Aginev\Acl\Http\Controllers\PermissionController@index')
                         ->with('success', trans('acl::permission.create.created'));
    }
850107
public function store(Request $request)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $request->validate([
            'email' => 'required|email',
            'name' => 'max:36',
        ]);
        $invitedMember = $this->createInvitedMember($request);
        $memberInvitation = $this->createMemberInvitation($request->email, $invitedMember->id);
        $invitedMember->notify(new MemberInvited($memberInvitation));
        /** @noinspection PhpUndefinedMethodInspection */
        return fractal($memberInvitation, new MemberInvitationTransformer())
            ->includeInvitedMember()
            ->withResourceName('memberInvitation')
            ->respond();
    }
214613
public function store(Request $request)
    {
        $this->validate($request, ['text' => 'required|max:64|regex:/^[ a-zA-Z0-9_.-]*$/']);

        // Check if the tag already exists and if so silently return it.
        $tag = Tag::where(DB::raw('LOWER(text)'), strtolower($request->text))->first();
        if(!$tag){
            $tag = new Tag();
            $tag->user_id = $request->user()->id;
            $tag->text = $request->text;
            $tag->save();
        }

        $results = fractal()->item($tag, new TagTransformer());
        return response()->json($results);
    }
616472
public function store(Request $request)
    {
        $this->roles->create($request->only('name', 'label'));
        return \Redirect::route('admin.roles.index', [
         ])->withMessage(trans('acl::role.roles-controller-successfully_created'));
    }
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')]));
    }
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!');
    }
27784
public function store(Request $request)
    {
        Role::create($request->all());

        session()->flash('success' , 'Rol creado con exito');
        return redirect()->route('roles.index');
    }
1204787
public function store(Request $request)
    {
        $this->validate($request, NavigationAdmin::$rules, NavigationAdmin::$messages);

        $inputs = $request->only([
            'icon',
            'title',
            'slug',
            'description',
            'help_index_title',
            'help_index_content',
            'help_create_title',
            'help_create_content',
            'help_edit_title',
            'help_edit_content',
            'parent_id',
            'url_parent_id'
        ]);
        $inputs['is_hidden'] = boolval($request->has('is_hidden'));
        $inputs['url_parent_id'] = ($inputs['url_parent_id'] == 0 ? $inputs['parent_id'] : $inputs['url_parent_id']);

        $row = $this->createEntry(NavigationAdmin::class, $inputs);

        if ($row) {
            $row->updateUrl()->save();
            $row->roles()->attach(input('roles'));
        }

        return redirect_to_resource();
    }
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;
    }
193703
public function store(Request $request)
    {
        $this->validate($request, Role::$rules, Role::$messages);

        $this->createEntry(Role::class, $request->all());

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

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

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

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

        return redirect()->action('\Kordy\Ticketit\Controllers\StatusesController@index');
    }
1061594
public function store(CreateUserRequest $request)
    {
        $input = $request->all();

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

        return $this->sendResponse($user, 'User saved successfully.');
    }
570715
public function store(Request $request)
    {
        try {
            $contentType = $this->contentTypes->save($request);
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.create', ['object' => trans('soda::terminology.content_type')]));
        }

        return redirect()->route('soda.content-types.edit', $contentType->getKey())->with('success', trans('soda::messages.created', ['object' => trans('soda::terminology.content_type')]));
    }
1340557
public function store(Request $request)
    {
        $this->validation->make($request->all(), [
            'name' => 'required|max:255',
            'scopes' => 'array|in:'.implode(',', Passport::scopeIds()),
        ])->validate();

        return $request->user()->createToken(
            $request->name, $request->scopes ?: []
        );
    }
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');
    }
745332
public function store(Request $request)
    {
        $user = new \App\User();

        $user->email = $request->email;
        $user->name = $request->name;
        $user->password = Hash::make($request->password);

        $user->save();

        return redirect('scaffold-users');
    }
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!');
    }