Store a newly created user.

@param \Yajra\CMS\Contracts\Validators\StoreUserValidator $request
@return \Illuminate\Http\RedirectResponse
347750
public function store(StoreUserValidator $request)
    {
        $user               = new User($request->all());
        $user->password     = bcrypt($request->get('password'));
        $user->is_activated = $request->get('is_activated', false);
        $user->is_blocked   = $request->get('is_blocked', false);
        $user->is_admin     = $request->get('is_admin', false);
        $user->save();
        $user->syncRoles($request->get('roles'));

        event(new UserWasCreated($user));

        flash()->success('User ' . $user->first_name . 'successfully created!');

        return redirect()->route('administrator.users.index');
    }
163199
public function store(Request $request)
	{
		$this->authorize('blog',  Auth::user());
	
		$this->validate($request, Evento::storeRules());
		$id = \DB::transaction(function () use ($request){
			$evento = Evento::create(Evento::storeAttributes($request));

			return $evento->id;
		});
		
		return redirect(route('evento.edit', $id));
	}
38196
public function saveUser(User $user, Request $request)
    {
        $user->fill($request->get('user'))
            ->save();

        Alert::info(__('User was saved.'));

        return back();
    }
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');
    }
115982
public function store(Request $request)
    {
        $attributes = request()->validate(News::$rules, News::$messages);

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

        return redirect_to_resource();
    }
746580
public function store(Request $request)
    {
        $this->validate($request, $this->rules);

        $url = SlugUrl($request->input('titulo'));

        $row = new Tag($request->all());
        $row->slug_url = $url;
        $this->tagRepo->create($row, $request->all());

        flash()->success('El registro se agregró satisfactoriamente.');

        return redirect()->route('admin.tags.index');
    }
55342
public function store(Request $request)
    {
        $request = $this->processRequest($request);

        if ($request === true) {
            return $this->redirection();
        }

        $this->validate($request, $this->model->rules());

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

        $saved = $this->afterSaving($request);

        if ($saved) {
            return $this->redirection();
        }
    }
205499
public function store(Request $request)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Language', (isset($request->id)) ? 'update' : 'create')) {
            return $this->noPermission();
        }
        // custom messages for validation
        $messages = array(
            'name.required'=>'Language name is required',
        );

        $validatorValues = [
            'name' => 'required',
            'isDefault' => 'required',
            'isVisible' => 'required',
            'slug' => 'required|max:500|unique:languages',
        ];
        if(isset($request->id)) {
            unset($validatorValues['slug']);
        }

        // validation
        $validator = Validator::make($request->all(), $validatorValues, $messages);
        // if validation fails return json response
        if ($validator->fails()) {
            return $this->response("Please check all required fields!", 400, null, false, false, true, $validator->errors());
        }

        if($request->isDefault == true) {
            // remove the current default language ( set it to non-default ) if this new one is the default
            Language::where('isDefault', 1)->update(
                [
                'isDefault'    => 0,
                ]
            );
        }

        // createdByUserID, slug and nativeName don't need to be updated
        if(isset($request->id)) {
            $language = Language::findOrFail($request->id);
        }else{
            $language = new Language();
            $language->createdByUserID = Auth::user()->userID;
            $language->slug = $request->slug;
            $language->nativeName = $request->nativeName;
        }
        $language->name = $request->name;
        $language->isDefault = $request->isDefault;
        $language->isVisible = $request->isVisible;

        if($language->save()) {
            // create virutal column for slug of every post type in the created language
            $allPostTypes = PostType::all();
            foreach ($allPostTypes as $postType){
                PostType::createVirtualColumnsForSlug($postType->slug, $language->slug);
            }

            // create labels
            if(!isset($request->id)) {
                $this->createNewLanguageLabels($language->slug);
            }

            $redirectParams = parent::redirectParams($request->redirect, 'language', $language->languageID);
            $result = $this->response('Language is stored', 200, $language->languageID, $redirectParams['view'], $redirectParams['redirectUrl']);
        }else{
            $result = $this->response('Language could not be stored. Internal server error. Please try again later', 500);
        }
        return $result;

    }
297464
public function store(Request $request)
    {
        $validation = app(ValidationService::class)->check(Blog::$rules);

        if (!$validation['errors']) {
            $blog = $this->repository->store($request->all());
            Cms::notification('Blog saved successfully.', 'success');
        } else {
            return $validation['redirect'];
        }

        if (!$blog) {
            Cms::notification('Blog could not be saved.', 'warning');
        }

        return redirect(route($this->routeBase.'.blog.edit', [$blog->id]));
    }
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')]));
    }
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'));
    }
519316
public function store(Request $request)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('user', (isset($request->user['id'])) ? 'update' : 'create')) {
            return $this->noPermission();
        }
        // custom messages for validation
        $messages = array(
          'email.required'=>'You cant leave Email field empty',
          'firstName.required'=>'You cant leave name field empty',
        );

        $validatorFields = [
            'firstName' => 'required',
            'lastName' => 'required',
            'email' => 'required|unique:users',
            'groups' => 'required',
        ];

        if(isset($request->user['id'])) {
            // update user
            $user = App\Models\User::findOrFail($request->user['id']);
            $user->isActive = $request->user['isActive'];
            $currentID = $request->user['id'];
            if($user->email == $request->user['email']) {
                unset($validatorFields['email']);
            }
        }else{
            // Create user
            $user = new User();
            $user->createdByUserID = Auth::user()->userID;
            $user->password = Hash::make($request->user['password']);
            $user->isActive = 1;
            $currentID = 0;

            $validatorFields['password'] = 'required|same:confpassword';
        }

        // validation
        $validator = Validator::make($request->user, $validatorFields, $messages);

        // if validation fails return json response
        if($validator->fails()) {
            return $this->response("Please check all required fields!", 400, null, false, false, true, $validator->errors());
        }

        // if image is not set make it 0
        if (!isset($request->user['profileImageID']) || $request->user['profileImageID'] == "") {
            $profileImageID = null;
        }else{
            $profileImageID = $request->user['profileImageID'];
        }

        // Store data
        $user->email = $request->user['email'];
        $user->firstName = $request->user['firstName'];
        $user->lastName = $request->user['lastName'];
        $user->phone = $request->user['phone'];
        $user->street = $request->user['street'];
        $user->country = $request->user['country'];
        $user->slug = parent::generateSlug($request->user['firstName']." ".$request->user['lastName'], 'users', 'userID', '', $currentID, false);
        $user->about = $request->user['about'];
        $user->profileImageID = $profileImageID;
        $user->gravatar = User::getGravatarFromEmail($request->user['email']);

        if($user->save()) {
            // Add roles permissions
            $user->assignRoles($request->user['groups']);

            $redirectParams = parent::redirectParams($request->redirect, 'user', $user->userID);
            $result = $this->response('User stored successfully', 200, $user->userID, $redirectParams['view'], $redirectParams['redirectUrl']);
            $result['data'] = $user;
        }else{
            $result = $this->response('User could not be stored. Internal server error. Please try again later', 500);
        }
        return $result;
    }
585902
public function put(Request $request)
    {
        $user = $this->getUser();

        $userValidationCopy = clone $user;

        // Validate the modified fields
        $content = $this->getContentAsArray($request);

        $errors = $this->userValidator->validate($content, $user);

        if (count($errors) > 0) {
            return $this->createConstraintViolationResponse($errors);
        }

        $userValidationCopy->exchangeArray($content ?: [])->getArrayCopy();

        try {
            $user = $this->userService->update($user, $this->getContentAsArray($request));
        } catch (OutOfBoundsException $e) {
            return $this->createEmailNotUniqueResponse();
        }

        return $this->userArrayWithoutPassword($user);
    }
1236799
public function store(Request $request)
	{
		$this->authorize('blog',  Auth::user());
    
    	$this->validate($request, Post::storeRules());
    
    	$this->validate($request, Category::storeRules());
    	$this->validate($request, Tag::storeRules());
    	
    	\DB::transaction(function () use ($request){
    		$post = Post::create(Post::storeAttributes($request));
    		
    		$categories = explode(',', $request->categories);
    		// remove empty items from array
    		$categories = array_filter($categories);
    		// trim all the items in array
    		$categories =array_map('trim', $categories);
    		
    		$post->saveCategories($categories);   		 
    		
    		$tags = explode(',', $request->tags);
    		
    		// remove empty items from array
    		$tags = array_filter($tags);
    		// trim all the items in array
    		$tags =array_map('trim', $tags);
    		
    		$post->saveTags($tags);
    		    		
    		
    	});
    	
    
    
    	return redirect(route('blog'));
	}
844366
public function store(CreateUserRequest $request)
    {
        $user = User::create([
            'name' => $request->input('name'),
            'email' => $request->input('email'),
            'password' => bcrypt($request->input('password')),
        ]);

        event(new UserCreated($user));

        return Response::json(['created' => true ]);
    }
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');
    }
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()
            ]);
        }
    }