Store a newly created resource in storage.

@return Response
495760
public function store(StoreRequest $request)
	{		
		$level = "danger";
		$message = " You are not permitted to create roles.";

		if ( Shinobi::can ( config('watchtower.acl.role.create', false) ) ) {
			Role::create($request->all());
			$level = "success";
			$message = "<i class='fa fa-check-square-o fa-1x'></i> Success! Role created.";
		}

		return redirect()->route( config('watchtower.route.as') .'role.index')
				->with( ['flash' => ['message' => $message, 'level' =>  $level] ] );
	}
533510
public function store(Request $request)
    {
        // Instantiate a new model item.
        $modelClass = $this->getModelClass();
        $item = new $modelClass;

        // Validate the request.
        $this->validate($request, $item->getValidationRules());

        // Create the new item.
        $itemData = $request->all();
        $item->fill($itemData);
        $item->save();

        $newItem = call_user_func([$this->getModelClass(), 'find'], $item->id)->toArray();
        return $this->generateResponse($this->modelTableName, $newItem);
    }
233325
public function store()
    {
        $inputs = Input::all();

        if ( $this->form->create($inputs) )
        {
            return Redirect::route('cpanel.permissions.index')
                ->with('success', Lang::get('cpanel::permissions.create_success'));
        }

        return Redirect::back()
            ->withInput()
            ->withErrors($this->form->getErrors());
    }
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');
    }
125398
public function store(Create $request)
    {
        $data = $request->all();

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

        $user->addRole($request->get('role'));

        return $this->redirect('users.index');
    }
1288068
public function store() {
		$this->_storePrecheck();
		$model = $this->loadModel($this->params['model']);
		$fileData = StorageUtils::fileToUploadArray($this->args[0]);
		$entity = $model->newEntity([
			'adapter' => $this->params['adapter'],
			'file' => $fileData,
			'filename' => $fileData['name']
		]);

		if ($model->save($entity)) {
			$this->out('File successfully saved!');
			$this->out('UUID: ' . $entity->id);
			$this->out('Path: ' . $entity->path());
		} else {
			$this->abort('Failed to save the file.');
		}
	}
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();
    }
1048835
public function store()
    {
        // Check whether the object has ever been stored.
        if ($this->isNew) {
            Logger::get()->debug('Storing new entity ' . get_class($this) . '...');
            // Create the record. Get an ID back.
            $this->id = $this->getDataSource()->create($this->getFieldsData());
            // Store this object in the appropriate factory for further use.
            $this->getFactory()->registerEntity($this);
        } else {
            Logger::get()->debug('Updating entity ' . get_class($this) . ":{$this->id}...");
            $this->getDataSource()->update($this->id, $this->getFieldsData());
        }

        // Once stored, the entity is no longer new.
        $this->isNew = false;
    }
677499
public function store()
    {
        $attributes = request()->validate(DocumentCategory::$rules, DocumentCategory::$messages);

        $category = $this->createEntry(DocumentCategory::class, $attributes);

        return redirect_to_resource();
    }
1335887
public function store()
    {
        if (empty($this->request->file) || get_pref('production_status') != 'live') {
            return;
        }

        foreach ($this->config->skipPaths as $path) {
            if (strpos($this->request->uri, $path) === 0) {
                return;
            }
        }

        $this->getHeaders();

        if (isset($this->headers['content-type']) &&
            strpos($this->headers['content-type'], 'text/html') === false
        ) {
            return;
        }

        $page = ob_get_contents();

        if (($r = callback_event('rah_cache.store', '', 0, array(
            'contents' => $page,
            'headers'  => $this->headers,
        ))) !== '') {
            $page = $r;
        }

        if (!$page) {
            return;
        }

        file_put_contents($this->request->file, $page);

        $size = strlen($page);
        $crc = crc32($page);
        $data = gzcompress($page, 6);
        $data = substr($data, 0, strlen($data)-4);
        $data = "\x1f\x8b\x08\x00\x00\x00\x00\x00".$data;
        $data .= pack('V', $crc);
        $data .= pack('V', $size);
        file_put_contents($this->request->file.'.gz', $data);

        callback_event('rah_cache.created');
    }
508873
public function store(Create $request)
    {
        $data = $request->all();

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

        return $this->redirect('roles.index');
    }
876949
public function save()
    {
        $resourceResponse = null;

        if ($this->isCreatable() && !$this->isUpdateable()) { //available for creation
            $resourceResponse = $this->customerResource->save(
                $this->transform(ModelInterface::TRANSFORM_TO_JSON_ARRAY)
            );
        }

        if ($this->isUpdateable() && !$this->isCreatable()) { //available for update
            $resourceResponse = $this->customerResource->update(
                $this->customerId,
                $this->transform(ModelInterface::TRANSFORM_TO_JSON_ARRAY)
            );
        }

        if ($resourceResponse == null) {
            throw new \InvalidArgumentException('You Cant Perform This Operation on an empty customer object');
        }

        if ($resourceResponse instanceof \Exception) {
            throw $resourceResponse;
        }

        return $this->_setAttributes($resourceResponse);
    }
519914
public function createResponse()
    {
        // Cannot continue if a resource has not been set
        if (!$this->resource instanceof ResourceInterface) {
            return $this->response;
        }

        return $this->response
            ->setResource($this->resource)
            ->create();
    }
1707
public function store()
    {
        $password = Str::random();

        $input = array_merge(Binput::only(['first_name', 'last_name', 'email']), [
            'password'     => $password,
            'activated'    => true,
            'activated_at' => new DateTime(),
        ]);

        $rules = UserRepository::rules(array_keys($input));
        $rules['password'] = 'required|min:6';

        $val = UserRepository::validate($input, $rules, true);
        if ($val->fails()) {
            return Redirect::route('users.create')->withInput()->withErrors($val->errors());
        }

        try {
            $user = UserRepository::create($input);

            $groups = GroupRepository::index();
            foreach ($groups as $group) {
                if (Binput::get('group_'.$group->id) === 'on') {
                    $user->addGroup($group);
                }
            }

            $mail = [
                'url'      => URL::to(Config::get('credentials.home', '/')),
                'password' => $password,
                'email'    => $user->getLogin(),
                'subject'  => Config::get('app.name').' - New Account Information',
            ];

            Mail::queue('credentials::emails.newuser', $mail, function ($message) use ($mail) {
                $message->to($mail['email'])->subject($mail['subject']);
            });

            return Redirect::route('users.show', ['users' => $user->id])
                ->with('success', 'The user has been created successfully. Their password has been emailed to them.');
        } catch (UserExistsException $e) {
            return Redirect::route('users.create')->withInput()->withErrors($val->errors())
                ->with('error', 'That email address is taken.');
        }
    }
405877
private function _store() {
		// Flushes the buffers
		$output = ob_get_flush();

		\wp_cache_add( $this->key, $output, $this->group, $this->expires );
	}
558606
private function create()
    {
        $response = $this->sendRequest(
            self::METHOD_POST,
            self::$endPoints['create'],
            $this->requestData
        );
        $this->resetRequestData();
        return $response;
    }
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() . '.'];
    }