Store a newly created role in storage.

@return Response
508873
public function store(Create $request)
    {
        $data = $request->all();

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

        return $this->redirect('roles.index');
    }
825383
public function newAction() {

        $entity = new Role();

        $form = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
258531
public function store()
    {
        $request = $this->makeRequest('store');
        $model = $this->service->create($request);

        if(is_a($model, \Exception::class)) {

            return $this->getErrorResource($model);

        } else {

            return $this->maybeMakeResource('single', $model, 201);
        }

    }
511764
public function storeResource()
    {
        $this->validate($this->request, [
            'resource' => 'required|alpha_num',
        ]);

        $permissions = Permission::createResource($this->request->resource);
        foreach ($permissions as $permission) {
            $permission->syncRoles($this->request->get('roles', []));
        }

        return redirect()->route('administrator.permissions.index');
    }
305936
public function store()
    {
        if ($this->id !== null) {
            $method = 'PUT';
            $path = '/' . $this->id;
        } else {
            $method = 'POST';
            $path = '';
        }
        $response = $this->request($method, $path, [], json_encode($this->data));
        $treatedContent = $response->getTreatedContent();

        $this->id = $treatedContent['_id'];
        $this->version = $treatedContent['_version'];
        $this->dirty = false;
    }
323926
public function store() {
        $options = $this->getOptions();
        $key = self::DEFAULT_REGISTRY_KEY;

        if (isset($options['storage']['registry']['key'])
            && !empty($options['storage']['registry']['key'])
        ) {
            $key = $options['storage']['registry']['key'];
        }

        Zend_Registry::set($key, $this->_acl);
    }
167803
public function store()
    {
        $attributes = request()->validate(Page::$rules, Page::$messages);

        $attributes['is_header'] = boolval(input('is_header'));
        $attributes['is_hidden'] = boolval(input('is_hidden'));
        $attributes['is_footer'] = boolval(input('is_footer'));
        $attributes['is_featured'] = boolval(input('is_featured'));
        $attributes['url_parent_id'] = ($attributes['url_parent_id'] == 0 ? $attributes['parent_id'] : $attributes['url_parent_id']);

        $page = $this->createEntry(Page::class, $attributes);

        if ($page) {
            $page->updateUrl()->save();
            $page->banners()->sync(input('banners'));
        }

        return redirect_to_resource();
    }
214810
function save() {
		if (!$this->id)
			$this->id=uniqid(NULL,TRUE);
		$_SESSION[$this->key][$this->id]=$this->item;
		return $this->item;
	}
1051705
public function store()
    {
        $credentials = \Input::only('email', 'password');
        $remember = \Input::has('remember');

        if (\Auth::attempt($credentials, $remember)) {
            $_SESSION['admin'] = \Auth::id();

            return $this->redirect('home')->withFlashMessage('Login Success!');
        }

        if (getenv('PINGPONG_ADMIN_TESTING')) {
            return \Redirect::to('admin/login')->withFlashMessage('Login failed!')->withFlashType('danger');
        }

        return \Redirect::back()->withFlashMessage('Login failed!')->withFlashType('danger');
    }
848753
public function store(RoleRequest $request)
    {
        // Create the role
        $role = Role::create($request->all());

        // Sync permissions
        $permission_ids = $request->get('permission_id', []);
        $role->permissions()->sync($permission_ids);

        return redirect()->action('\Aginev\Acl\Http\Controllers\RoleController@index')
                         ->with('success', trans('acl::role.create.created'));
    }
922479
public function store()
    {
        $class = $this->model;

        $this->validate(request(), $this->getValidationRules());

        // Create
        $model = new $class($this->input);
        return $model->save()
            ? [
                'success' => ucfirst($this->readableResourceType()) . ' created successfully.',
                'model' => $model->toArray(),
            ]
            : ['error' => 'There was a problem saving the ' . $this->readableResourceType() . '.'];
    }
820614
public function store(RoleRequest $request)
    {
        $data = [
            'slug' => $request->get('slug'),
            'name' => $request->get('name')
        ];

        $role = Role::create($data);

        if ($role) {
            $permissionIds = array_filter($request->get('permissions'));
            $role->permissions()->sync($permissionIds);
        }

        return redirect()->route('admin::roles.index');
    }
1141439
public function storeData()
    {
        $data = $this->getData();
        $id   = $this->getId();

        try {
            $storageService = $this->getServiceLocator()->get(Storage::SERVICE_ID);
            $storageService->store($id, $data);
            $this->returnJson(array('success' => true, 'type' => 'success'));
        } catch (StorageException $e) {
            $this->logInfo($e->getMessage());
            $this->returnJson(array('success' => false, 'type' => 'error'));
        }
    }
654587
public function store(FormRequest $request)
    {
        $data = $request->all();
        $roleData = Arr::except($data, ['exit', 'permissions']);
        $role = $this->repository->create($roleData);

        if ($role) {
            $permissions = isset($data['permissions']) ? $data['permissions'] : [];
            $role->syncPermissions($permissions);
        }

        return $this->redirect($request, $role);
    }
780092
public function store(CreateRole $request)
    {
    	 $this->validate($request, array(
	        'name' => 'required|unique:roles',
	        'code' => 'required|unique:roles',
	    ));
        $role = new Role;
		$role->name = $request->name;
		$role->code = $request->code;
		$role->save();
		
		return redirect(url("role"))->with('dp_announce', trans('deeppermission.alert.role.created'));
    }
536197
public function store()
    {
        if (!Input::has('product')) {
            return $this->jsonErrorResponse('"product" is required.');
        }

        $product = Subbly::api('subbly.product')->create(Input::get('product'), Input::get('locale', null));

        return $this->jsonResponse(array(
            'product' => $this->presenter->single($product),
        ),
        array(
            'status' => array(
                'code'    => 201,
                'message' => 'Product created',
            ),
        ));
    }
493323
protected function insertService()
    {
        $data = $this->package->getResourceFromZip('system/service.json');
        $services = $this->cleanDuplicates($data, 'system', 'service');

        if (!empty($services)) {
            try {
                foreach ($services as $i => $service) {
                    unset($service['id']);
                    unset($service['last_modified_by_id']);
                    $service['created_by_id'] = Session::getCurrentUserId();
                    if (!empty($oldRoleId = array_get($service, 'config.default_role'))) {
                        $newRoleId = $this->getNewRoleId($oldRoleId);
                        if (!empty($newRoleId)) {
                            array_set($service, 'config.default_role', $newRoleId);
                        } else {
                            // If no new role found then do not store config. default_role field is not nullable.
                            $this->log(
                                'warning',
                                'Skipping config for service ' .
                                $service['name'] .
                                '. Default role not found by role id ' .
                                $oldRoleId
                            );
                            \Log::debug('Skipped service.', $service);
                            unset($service['config']);
                        }
                    }
                    if (!empty($oldDoc = array_get($service, 'doc'))) {
                        $service['service_doc_by_service_id'] = $oldDoc;
                        unset($service['doc']);
                    }
                    $services[$i] = $service;
                }

                $payload = ResourcesWrapper::wrapResources($services);
                $result = ServiceManager::handleRequest(
                    'system', Verbs::POST, 'service', [], [], $payload, null, true, true
                );
                if ($result->getStatusCode() >= 300) {
                    throw ResponseFactory::createExceptionFromResponse($result);
                }

                return true;
            } catch (\Exception $e) {
//                if ($e->getCode() === HttpStatusCodes::HTTP_FORBIDDEN) {
//                    $this->log('error', "Failed to insert services. " . $this->getErrorDetails($e));
//                } else {
//                    throw new InternalServerErrorException("Failed to insert services. " . $this->getErrorDetails($e));
//                }
                $this->throwExceptions($e, 'Failed to insert services');
            }
        }

        return false;
    }